Click here to Skip to main content
15,996,250 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Count =0
set op=conn.Execute(sql)
do while not op.eof


Count =count +1
sendMail op("mail"),strFrom,strSubject,mailBody

What I have tried:

how to delay this command to loop for 5 seconds
Posted
Updated 6-Dec-17 23:04pm
Comments
Karthik_Mahalingam 7-Dec-17 4:04am    
F-ES Sitecore 7-Dec-17 5:01am    
Is there a reason you want it to wait? ASP.net architecture is such that it expects requests to be finished quickly, if you have a process that waits 5 seconds and hundreds of people request the same page then you'll run out of usable threads and your site will become unresponsive.

1 solution

Pausing a program is accomplished using (as Karthik suggested) Thread.Sleep Method (System.Threading)[^]. Please consider putting your 'paused code' in a worker thread.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900