robinmthomas Posted April 1, 2002 Share Posted April 1, 2002 I want to create a time in ASP.NET, however, I am not sure how to do that. Here is my situation: I need to be able to do something about a specific time each day. Can I do this in ASP.NET? i.e. Every morning, I need it to query a database and email people if there are records that match a criteria. How can I get ASP.NET to queury at a specific time. This is a fairly low traffic website, so I can't incorporate a check with every page request. Any ideas? Link to comment Share on other sites More sharing options...
0 Gumboot Posted April 1, 2002 Share Posted April 1, 2002 Look up the docs for System.Threading.Timer. This basically calls a method at regular intervals. Here is an example: // Calculate length of time remaining until 9am. TimeSpan timeOfDay = new TimeSpan(9, 0, 0); TimeSpan dueTime = timeOfDay - DateTime.Now.TimeOfDay; if (dueTime ;) Link to comment Share on other sites More sharing options...
Question
robinmthomas
I want to create a time in ASP.NET, however, I am not sure how to do that.
Here is my situation:
I need to be able to do something about a specific time each day. Can I do this in ASP.NET?
i.e. Every morning, I need it to query a database and email people if there are records that match a criteria.
How can I get ASP.NET to queury at a specific time. This is a fairly low traffic website, so I can't incorporate a check with every page request.
Any ideas?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts