B
BolineC
I am trying to use a timer in a simplistic windows service... In my
OnStart method, I declare and initialize the System.Threading.Timer,
and set it to fire every 30 seconds. In my callback method, I read
from one Database, and write to another. Mainly that is all it does.
(This only takes around 5 seconds to complete)
So, my problem is... All this is only happening once! My timer only
callsback one time. I am wondering if this is because my reference to
it drops out of scope into GC land? If that is the case, with such a
simple app, how can I keep it in scope?
Craig
OnStart method, I declare and initialize the System.Threading.Timer,
and set it to fire every 30 seconds. In my callback method, I read
from one Database, and write to another. Mainly that is all it does.
(This only takes around 5 seconds to complete)
So, my problem is... All this is only happening once! My timer only
callsback one time. I am wondering if this is because my reference to
it drops out of scope into GC land? If that is the case, with such a
simple app, how can I keep it in scope?
Craig