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.
Loading
Brett BarneyPosted Oct 26, 2007, 6:10 PM
Thank you for your reply. I'll check into the example and see if this will work for me.
Thanks again for your help!
Scott LyslePosted Oct 26, 2007, 4:38 PM
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