I have a program that checks a database for pending orders. If there are no pending orders when the program starts, the program won't do anything because it needs the pending orders to process them. I need to be able to re-check the database at a specific time interval (10 minutes) to see if any orders have become "pending". If the program finds pending orders, it needs to execute methods using the returned pending orders. Would the best way to accomplish this be a timer? If so, how would it be set up? If not a timer, what else would accomplish this?
Thank you in advance for your help.
Timer to check database?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Scott LysleRank #49 · 31K reputationPosted Oct 26, 2007, 12:38 PM EDT
If this application does not need to actually present a UI; you might consider writing it as a windows service and using the System.Threading.TimerCallback delegate to handle the execution of your process on a timed interval.
There is a short example of the use of the TimerCallback delegate here:
http://msdn2.microsoft.com/en-us/library/system.threading.timercallback(vs.80).aspx
Brett Barney3 reputationPosted Oct 26, 2007, 2:10 PM EDT
Thank you for your reply. I'll check into the example and see if this will work for me.
Thanks again for your help!