I am developing in VB using VS 2008.
Need to query a table to get a work queue id. Need to run query every 60 seconds. If query returns id, then do some work...if result set is empty then wait 60 seconds (or some time interval) before executing query again. This task needs to run in the background on a workstation.
After browsing experts exchange, google, etc..., it seems that a Windows Service should be created for this task instead of a console app.
Looking for examples to get me started in creating the windows service.
I have the vb.net code to query the database. So, just looking for an example of how to contruct the service. Should this code be placed in the OnStart() or should I create another class/module/function and call from/to?
Should I have an infinite loop that executes the query every 60 seconds in the OnStart() or is that not needed since the windows service inherently is supposed to run "forever"? Is this how the "Timer" comes into play? How do I add the System Timer instead of the Forms Timer?
Recommendations? Thoughts? Examples?
Thanks in advance,