All,
I have a Windows Service and it has one System.Timers.T imer that
fires every 500 milliseconds. Now I have noticed that there's a bug in
System.Timers.T imer when it's being used combined with Windows Service.
That is, the Timer won't fire again once it's stopped (Timer.Stop() or
Timer.Enabled = False) (http://support.microsoft.com/kb/842793/en-us).
Instead of using Threading.Timer , can I just have the code to run
inside the System.Timers.T imer Handler? However, this block of code
would take at least one or two seconds to run and it will go into the
database (using ADO). Would this cause a new Timer (Thread) to fire
since the process time is actually greater than the elapsed time?
Sample Code
Sub Timer1_TimerCal lBack(ByVal source As Object, ByVal e As
Timers.ElapsedE ventArgs)
'Don't stop the timer...
'Calling a sub and processing it.
DoSomthing()
End Sub
Private Sub DoSomthing()
'Processing and accessing the database...
End Sub
Thanks,
Carl