Send email when first record updated problem

Hi guys i have problem
this code send email based on timer every 5 minutes
it working ok but my problem i need to determine first rcord updated not inserted
and send email this is starting work
this is my code
---timer1_Tick---
Sales.SalesClass SalesClass1 = new Sales.SalesClass();
DataTable dt = SalesClass1.ShowSalesData("Data Source=192.168.1.5;Initial Catalog=Altawi-last06-01-2015;User ID=admin;Password=123");
dataGridView1.DataSource = dt;
dataGridView1.Refresh();
namespace Sales
class SalesClass
public DataTable ShowSalesData(string ConnectionString)
SqlConnection con = new SqlConnection(ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "showsales1";
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
return dt;
SELECT     ROW_NUMBER() OVER (ORDER BY dbo.[Jeddah-Live$Sales Header].No_) AS [م], dbo.[Jeddah-Live$Sales Line].[Document No_] AS 'رقم الطلب',
dbo.[Jeddah-Live$Sales Header].[Bill-to Name] AS 'العميل', dbo.[Jeddah-Live$Sales Line].Area AS 'نوع الصبه', dbo.[Jeddah-Live$Sales Line].Description AS 'البيان',
dbo.[Jeddah-Live$Sales Header].[Pump No_] AS 'المضخه', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].Quantity, 0, 1) AS int) AS 'المطلوب',
CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Quantity Shipped], 0, 1) AS int) AS 'المصبوب', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Outstanding Quantity], 0,
1) AS int) AS 'المتبقى '
FROM         dbo.[Jeddah-Live$Sales Header] INNER JOIN
                      dbo.[Jeddah-Live$Sales Line] ON dbo.[Jeddah-Live$Sales Header].No_ = dbo.[Jeddah-Live$Sales Line].[Document No_] AND
                      dbo.[Jeddah-Live$Sales Header].[Sell-to Customer No_] = dbo.[Jeddah-Live$Sales Line].[Sell-to Customer No_]
The code above not have any problem and working
When first record updated send email
Example to show
orderno   quantity  shipped quantity
12            20               0
13            30               0
14            25               0
15           22                0
suppose order no 14 shipped quantity updated be 10 (meaning 0 be 10
then send email with starting work
after this any updated to any record not send
no problem i dont need any send email code but how to get record updated first

Hi guys i have problem
this code send email based on timer every 5 minutes
it working ok but my problem i need to determine first rcord updated not inserted
and send email this is starting work
this is my code
---timer1_Tick---
Sales.SalesClass SalesClass1 = new Sales.SalesClass();
DataTable dt = SalesClass1.ShowSalesData("Data Source=192.168.1.5;Initial Catalog=Altawi-last06-01-2015;User ID=admin;Password=123");
dataGridView1.DataSource = dt;
dataGridView1.Refresh();
namespace Sales
class SalesClass
public DataTable ShowSalesData(string ConnectionString)
SqlConnection con = new SqlConnection(ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.Text;
cmd.CommandText = "showsales1";
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds);
DataTable dt = ds.Tables[0];
return dt;
SELECT     ROW_NUMBER() OVER (ORDER BY dbo.[Jeddah-Live$Sales Header].No_) AS [?], dbo.[Jeddah-Live$Sales Line].[Document No_] AS '??? ?????',
dbo.[Jeddah-Live$Sales Header].[Bill-to Name] AS '??????', dbo.[Jeddah-Live$Sales Line].Area AS '??? ?????', dbo.[Jeddah-Live$Sales Line].Description AS '??????',
dbo.[Jeddah-Live$Sales Header].[Pump No_] AS '??????', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].Quantity, 0, 1) AS int) AS '???????',
CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Quantity Shipped], 0, 1) AS int) AS '???????', CAST(ROUND(dbo.[Jeddah-Live$Sales Line].[Outstanding Quantity], 0,
1) AS int) AS '??????? '
FROM         dbo.[Jeddah-Live$Sales Header] INNER JOIN
                      dbo.[Jeddah-Live$Sales Line] ON dbo.[Jeddah-Live$Sales Header].No_ = dbo.[Jeddah-Live$Sales Line].[Document No_] AND
                      dbo.[Jeddah-Live$Sales Header].[Sell-to Customer No_] = dbo.[Jeddah-Live$Sales Line].[Sell-to Customer No_]
The code above not have any problem and working
When first record updated send email
Example to show
orderno   quantity  shipped quantity
12            20               0
13            30               0
14            25               0
15           22                0
suppose order no 14 shipped quantity updated be 10 (meaning 0 be 10
then send email with starting work
after this any updated to any record not send
no problem i dont need any send email code but how to get record updated first

Similar Messages

  • Send email when report data updated on report server

    Hii all
    please clear me what this triggers functions from me??
    i want to send report email to boss when report data updates on server
    i have used this but neither subscription shows last run time nor email get sent.
    how can i do this??  
    Dilip Patil..

    Hii all
    please clear me what this triggers functions from me??
    i want to send report email to boss when report data updates on server
    i have used this but neither subscription shows last run time nor email get sent.
    The so-called "trigger" is nothing than "when the snapshot has been updated". In other words: it's not the actual data that has changed but a new
    snapshot has been created, which in turn has it's own schedule.
    The wording "trigger" is a bad choice since when it has been introduced and has irritated many people since then.
    For a custom solution check this thread:
    Triggering Data Driven Subscriptions in SSRS
    Andreas Wolter (Blog |
    Twitter)
    MCM - Microsoft Certified Master SQL Server 2008
    MCSM - Microsoft Certified Solutions Master Data Platform, SQL Server 2012
    www.andreas-wolter.com |
    www.SarpedonQualityLab.com

  • Send email when a record is created/modified in IT0744 and IT0487

    Hi ABAP Experts,
    Good day! I'm quite new to ABAP Dev and I have a requirement like this:
    1. When a user created/modified a record in IT0744/IT0487, an automatic email notification will be sent to the desired  recipient.
    The requirement is to send an email with a sample template like this:
    Notification Trigger:     If Blacklist Status is = u2018Blacklistedu2019 and Reason is u2018Failure to turn up on work start dateu2019.
    Subject     Notification: Failure to turn up on work start date.
    Attachment     Yes / No
    Notification Message Layout Format
    [Name of New Hire] u2013 [NRIC of New Hire] failed to report for work on [Hire Date] as a [Position Title] at [Div/Branch].
    Kindly provide if possible some steps that will be easy to follow; a sample program will be helpful.
    Thanks a lot!
    Regards,
    jeff

    Hi,
    In the exit itself you can use this function module SO_DOCUMENT_SEND_API1 to send mail to desired user.
    Other way out is you can create Work flow and can use create and modify event for triggering the work flow.
    Hope this helps.
    Regards
    Bikas

  • I am having problems sending emails when using apps. I dont receive any emails when I try to send documents such as pdf or pictures. I tried sending it to my other email account but I don't get any email. What is wrong?

    I am having problems sending emails when using apps. I dont receive any emails when I try to send documents such as pdf or pictures. I tried sending it to my other email account but I don't get any email. What is wrong?

    System Preferences > Network > your-connection-medium > (Assist me) > ( Diagnostics )
    This sometimes provides additional helpful information, sometimes not so much.

  • Cannot send email when clicking lonk on web page

    I cannot send email when clicking link on web page. 
    When I would click the link to send via email I was being directed to hotmail to open new account.
    Today the tech tried to assist me and completely messed up my email capabilities by setting up
    windows live account.
    I am thoroughly disgusted with FIOS internet services..Every time I've called them in the past month problem has been with someone else whose portal services they are using.
    I cannot send emails because all my contact information cannot be moved.
    I'm paying for FIOS internet service that is almost non existent.
    THe VZ in home agent doesn't work nor does the FIOS information site.
    My next move is to get rid of FIOS.
    They create more problems then they solve with me.

    If I understand your problem correctly, you are having trouble when clicking on a MailTo link on any webpage? What loads when you click this type of link is a setting in your browser. If you tell us what browser you are using, we can try to direct you to the setting.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer as Accepted Solution so others can see the solution to the problem.
    "All knowledge is worth having."

  • HT4979 why can I not send email when away from my home wifi? Am able to receive messages OK, and outgoing mailserver is correct?

    Why am I unable to send email when away from my home wifi ? I am able to receive mail OK, and have double- checked the outgoing server which is correct. This problem is consistent with my Macbook Pro, iPhone, and iPad2.
    Attempts to send messages results in them sitting in the Outbox and never- ending 'sending message' displayed.
    I am able to send using my   me.com  server.
    Home service provider is Cogeco.
    Any help would be appreciated.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try a Reset - iPad How-Tos  http://ipod.about.com/lr/ipad_how-tos/903396/1/
    Or this - Delete the account in Mail and then set it up again.
     Cheers, Tom

  • Send email when ownership is assigned' is not working

    Send email when ownership is assigned'
    is not working
    even though this option is disabled designer workflow task creation sends an email to the user when task is assigned to the user.
    We have october CU updates 2013.
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    Hi Amit,
    Per my knowledge, if the task is created from a workflow, then you may use the task actions in the workflow.
    And some task actions will send an email to the user who the task is assigned to, so the email is sent from the workflow and it is not sent from the option “Send email when ownership is assigned”.
    If you are using 2013 workflow, the send email action cannot be prevented from the workflow.
    If you are using 2010 workflow, you can go into the task process to delete the Send an Email action.
    https://support.office.com/en-nz/article/Use-the-task-process-editor-for-approval-workflows-8680b4a4-36b1-441c-b070-e515976078aa#__toc264538566
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • TS2621 why may I send email when wi-fi is enabled, but not when it is disabled?

    iphone 4s with verizon will send email via wi-fi but not 3G. Are there any ideas why?

    Depends on the email account.  If it is from your Internet provider they may only allow use of their SMTP server for sending emails when on their network.  To send emails when not on their network (i.e. when using Cellular data) it would require using a different SMTP server.

  • My iPhone will not send emails when away from my home wifi

    my iphone will not send emails when away from home wifi any advice

    Hey craggee,
    Thanks for the question. This is usually do to a limitation by your ISP/email provider:
    If you are only able to use your email account while connected to your home network, this may be a limitation put in place by your email service provider. For further support, please contact your email service provider directly.
    iOS: Troubleshooting Mail
    http://support.apple.com/kb/TS3899
    Thanks,
    Matt M.

  • Trouble sending email when on Wifi.

    Can't send email when on Wifi, but can send when on 4G or maybe 3G - I forget. Can receive emails fine on both.  To further confuse things I have three email accounts on my phone, two of them have no trouble sending or receiving when on either wifi or 4G.. I've checked and compared settings dozens of time.
    I have a private hosted email account (not sure if that is the right word) But I don't have google, AOL, or something like that..
    Thanks

    "But wouldn't I be using the same outgoing mail server if I was wifi or 4G?"
         Yes it would be the same. Maybe I'm too tired to figure this out.
    The only other thing that comes to mind is that your wifi router's firewall may be blocking that port. But if that were the case, your PC or Mac wouldn't be able to send mail either.

  • Send email when a LWAPP AP is not reponding!

    Hi,
    Is it possible for the WLC 4404/25 to send email when it lost communication with an LWAPP AP?

    Not that I am aware of. If you are using an external dhcp server with reservations for the APs or static ip assignments, you can use a monitoring system to alert you

  • TS3899 I can't send email when wifi is on

    I can't send email when wifi is on. How do I fix??

    I can't send email when wifi is on. How do I fix??

  • Send Email when built in approval workflow status column changes to approved

    I Implemented the built in approval work flow in a document library,I want to send an email when the column indicating the status of the workflows changes from in progress to approved.

    Hi ,
    According to your description, my understanding is that you want to send email when the built-in approval workflow status was approved.
    For the default built-in approval workflow, per my knowledge, there is not a way to modify it. As a workaround, you can create a Reusable Workflow with SharePoint Designer 2010, and publish it to your SharePoint, then you can use it like the built-in approval
    workflow.
    You can do as the followings:
    Install SharePoint Designer 2010.
    Open your site with SharePoint Designer 2010.
    Click Workflow under Navigation.
    Click Reusable Workflow, and type a name.
    Add “Start Approval Process” action, in the ‘these user’ , type the approvers.
    Click ‘Approval’ field, and under Customization, click “Change the behavior of a single task”.
    On the “When a Task Completes”, add “Send an Email” action in the approved condition,like the screenshot below.
    Then save and publish the workflow, then you can use the workflow in your SharePoint site .
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • If i purchase a device through this official website,then how can i send warranty when the device have problem?

    if i purchase a device through this official website,then how can i send warranty when the device have problem?

    To purchase a device from the online US Apple Store you will need a US credit card with a valid US address and a valid US address to ship to. You cannot use a shipping forwarder.
    If you are in a different country you would have to return to the US to access your warranty.
    If you are in the US but not near an Apple Store you would start here for service: https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • I run DeviceDemo sample to send email, when click send email button after f

    I run DeviceDemo sample to send email, when click send email button after filling all fields, it took me to EverNote application, can not send email. does anyone has this kind experience? how to fix it?

    Hi,
    ADF Mobile cannot directly send emails as this is a security precaution of your mobile phone (imagine all applications could send mails without you confirming). Instead the send mail functionality launches the mail client you have configured and fill in the information you provided in the application. The mail function by the way is implemented through Cordova.
    Frank

Maybe you are looking for

  • My weather widget is set to California, and I am on the east coast. Way to reset it?

    For some reason, my weather widget (the slide down screen) is set to Cupertino, California. Problem: I'm in Washington, D.C and there isn't a real reason for it to be in California.... I updated my phone, so it is the most up to date. My locations se

  • Itunes plays one song at a time on PC

    I must have a toggle checked somewhere, but my desktop will only play one song at a time, then stop. My laptop plays right down the list, from where I begin until I stop the playback. Help!

  • Problems with iPhone 3.0 software on iPhone 3G

    I love the iPhone 3.0 software update. I just wish that Apple can fix the following problems now: 1. The phone starts to slow down, real slow, a day after the update. 2. Battery uses up like crazy, takes a much longer time to charge, and the phone ge

  • Help with importing files into Lightroom 3.2

    Nothing has changed on my Mac for a year, except installing Lightroom 3 two months ago. I have had no issues importing till yesterday. Imported 300 .CR2 files, installed another card into my card reader and it will not import the files from the same

  • Issue broadcasting to PDF

    Hello all, I am running into an issue when using the broadcasting option to PDF via Web Application Designer template. Once I receive the PDF in my mailbox, I open and get a message indicating " Insufficient data for image" then click ok and see my c