Click here to Skip to main content
14,643,391 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi,

I am using a window service with a task scheduler to run this service on every 5 minutes and every 5 minutes it updates the database table.

but the problem is when we start the service then it update the table but on every 5 minutes service is running but the data is not updated.

how to solve this problem??


thanks
Posted
Comments
Wes Aday 28-Apr-12 7:39am
   
What have you tried? What errors are you getting? Where is the code that demonstrates your problem?
P.Salini 28-Apr-12 7:44am
   
The problem may be with your query. paste the query so that we can help
deepa5 28-Apr-12 7:47am
   
I have made a batch file for my service then it give to task scheduler.It runs and also update the data at first time but I am given the settings in task scheduler to run every 5 minutes.so service is running on every 5 min but second time data is not updated.
deepa5 28-Apr-12 7:48am
   
UPDATE BookMaster SET AuthorName=@Author,Pages=@Pages,Title=@Title,Publisher=@Publisher,Year=@Date WHERE ISBN=@ISBN"
this is my query for update the data.But this is updating the data only first time.
digimanus 28-Apr-12 8:50am
   
have you set other values to the parameters before updating again?

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

If you are using System.Timers.Timer make sure you set the following :
timer.AutoReset = true;

So it will continue and not stop after the first time event.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100