I created .net Windows Service, and schedule it to run for every 5mins. This windows service contains the code that sends the emails and updates the table after sending the emails.
First I'm sending all the emails and then updating all the records in the db as bulk.So My question is I set the interval to 5mins, does it break my scenario like if it takes 5mins for sending emais,then timer stops with out updating the db, or it continues the execution until it completely execute the task.
_timer = new Timer(5* 60 * 1000);
_timer.Elapsed += new ElapsedEventHandler(OnTimerElapsed);
_timer.AutoReset = true;
_timer.Start();
........................
{//send one email at a time ..this is in loop
Library.SendEmail(edtls);
ds.Tables["EDts"].Rows[i]["Sent"] = 1;
ds.Tables["EDts"].Rows[i]["Status"] = "Sent";
ds.Tables["EDts"].Rows[i].EndEdit();
}..how about timer stop execution here(it sends the emails but doesn't update the table)
ds.Update(EDts, "EmailDts");//updating table here