Have a look at my answer here:
http://www.experts-exchang
It should be applicable in the same way to your case.
Main Topics
Browse All TopicsI have a simple Web Form that reads from the database and
sends out some emails.
I would like this to run automatically in the afternoon.
What are some options do accomplish this? thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Have a look at my answer here:
http://www.experts-exchang
It should be applicable in the same way to your case.
Actually, some of the suggestions by other people here should be also appropriate for you...
http://www.experts-exchang
Well, you put your code in Application_Start in global.asax which gets called on the first hit to the any page in your application.
So, assuming your site has any action at all you should have no problem - or you can make sure to hit a page after a restart of the server.
But, yes, if you can extract the code to a windows forms application (or even better a service) it is a better solution.
If you included the code you want to execute in the Page_Load event, then you could just use task scheduler to open up IE or your browser to the page, assuming it's on a working web server. In advanced options, just use iexplore.exe http://localhost/yourapp..
Business Accounts
Answer for Membership
by: mppetersPosted on 2005-12-12 at 13:59:39ID: 15469967
Eeeks. You want to do it from a web form? Why not have it as a separate program?
Then you could use the Windows Task Scheduler to run the program every so often.
Any way you look at it, you need some separate program to run the code.
Other options are:
- use a perl script (again, this would need to be run by the task scheduler)
- sql server has a built-in scheduler, could try using that (not sure how feasible)