Click here to Skip to main content
15,896,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
[no name] 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.
Herman<T>.Instance 28-Apr-12 8:50am    
have you set other values to the parameters before updating again?

1 solution

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

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900