Custom schedule task

Hi,

I’m only a novice asp.net developer and have never done this before. I have a developer working on a new web application for me. Part of the application allows the user to select a time when they receive an email, containing information collected throughout the day. The user can select a time, e.g. 5pm, then at 5pm every day they receive an automated email of information from the system. They can log in to their control panel and change this time.

My developer says there is only two ways to schedule this batch, but it’s not possible to let the user select a time. They have suggested:

a) Using a console application that will trigger the event everyday and send the batch update
b) Using a Windows Service that will deploy on your server and do the operation.

I really need the system to be able to let the user choose the time of their email. I hoped this would be possible with ASP.NET. Is it? If so, how?

Thanks for your thoughts folks…

Well, best would be to have the service execute something on a timer. Maybe every hour or so, then get your user to select hours : 05:00, 08:00, etc.

Then the service would need to select from the db who wants the notification at that time and send it out

I’d avoid services here–you want to do a scheduled task for a few reasons. Biggie is that you have lots of tricky to pin down issues when your app “lives” forever. Recovery, etc, become a bit more challenging as well. A console app is alot simpler to worry about.

Now, how to make it so the user can “pick” the time is to just run this task frequently, like every 5 minutes or so. ASP.NET never touches this side. That should be timely enough for email alerts while not being overly taxing on the server. And, if it is too much or too little, a scheduled task is very easy to reschedule whereas a service would require that to be accounted for in code.

have to agree with wwb here. I usually always use a console app and not a service. I also prefer scheduling a task. Although I do not think a service that that is only working every hour will be to taxing on the server.

But I would set a scheduled task to run every 30 or 60 min and just let the user select hours and half hour increments. That will be far less taxing IMHO. But it all depends on what the server is going to be used for. If it is dedicated to this task, then you can set it to run more often.