Click here to Skip to main content
15,886,551 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i press a start button then update database column value everyday and when i press stop button then database value can not update. how i solve this by asp.net using c sharp from code behind without loading page. Database value will update automatically .
Posted
Updated 10-Jan-16 7:33am
v2
Comments
Suvendu Shekhar Giri 10-Jan-16 13:26pm    
If I say "Just update it" then can you understand anything?
Similarly, we too do not understand when you say "can not update".
Share more details and the relevant code so that we'll be able to help you.
ridoy 10-Jan-16 13:28pm    
You need to create a windows Service to do the task.
PIEBALDconsult 10-Jan-16 13:33pm    
That's the wrong tool. If you are using SQL Server, then consider using SSIS.

One way is to create a job for SQL Server agent which would do the update on desired interval and your code would control if the job is enabled or not.

To create a job, have a look at Create a Job[^] and to toggle the enabled state, see sp_update_job (Transact-SQL)[^]

However, keep in mind that storing calculated values in the database is often not recommended.
 
Share this answer
 
v2
Hello,

If you want to update column in SQL server, then I would recommend you to use SQL Jobs, which would run daily at specific time and perform the query mentioned or the Stored Procedures.
Create New Jobs In SQL 2012[^]

Hope this is what you require.
Thanks
 
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