Click here to Skip to main content
15,904,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi coder in my application i have some details which user fill, after entering details and press on submit button it will store in the database. I have bit value associated with that form so that when user enter details and click on submit button bit become true.

What i want is after one day that bit automatically become false how can i do that
Posted
Updated 10-Sep-13 23:00pm
v2
Comments
ArunRajendra 11-Sep-13 5:02am    
use a schedule job to monitor and update.

Why use a bit for it? Wouldn't it be more informative and simpler to have a field with the modification date? You don't need to reset it because instead of changing every row in the database, the date changes automatically and is also just one value so way less work to perform (and already taken care of by the system itself). It also tells you when a user changed his/her details for the last time.

Good luck!
 
Share this answer
 
v2
Comments
amitesh1989 11-Sep-13 5:33am    
http://forums.asp.net/p/1934888/5505563.aspx?p=True&t=635144743011050836&pagenum=1 please go to that link it will show you what i want to do
E.F. Nijboer 11-Sep-13 6:04am    
I would also still use a modification date. You want a reset everyday or when the manager approved the change. So, the user can edit the details if the bit is 0 OR the modification date is not the current date. This prevents ugly processes and jobs and other kind of methods that should be used only as a last resort. Working with such scheduled jobs will create systems that are very unclear and full of surprises. In the future other developers will scratch their head wondering how that bit became false. Administrators wondering what this reset_user_details_bit_job is actually for. It is an extra process with functionality for some other application detached (also in documentation). (Re)-installing makes it error prone (how often should it run? Every day? Some (idiot) will come to the conclusion this task seems nice and light and assumes that it can configure it to run half way of the day.

Hopefully my point is made. These insignificant jobs are forgotten about and will come bite you later on...
What i want is after one day that bit automatically become false how can i do that

what you're doing to change the bit value? If you're executing any stored procedure then you could include an update statement(to update bit value) inside that stored procedure.

Here some ways[^]
 
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