Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi......

I want to know how I can check if a user has modified the text or not before I save the information in the database.
Posted
Updated 25-May-10 1:04am
v2

Very har to answer seing that you don't give us any specific information. It depends on how the text is displayed and/or entered.

If you show the text in a TextBox and let the user change it there, it's simple.

Save the original text in a string variable and compare the string variable to the textbox' text before saving

If Textbox1.Text <> theValueToBeginWith Then
   'Save the text
Else
   'Don't bother
End If
 
Share this answer
 
v2
It seems that you are looking for Optimistic locking of database records.

Check this.

http://www.blackwasp.co.uk/OptimisticLocking.aspx[^]
 
Share this answer
 
v2
You should provide more information on what you want to do.

The bottom line to what (I think) you want do to involves two variables:
1. Containing the original value.
2. Containing the value when saving.

When saving you compare the two and see if they are different. After the save has been completed succesfully, update the original value with the value you just saved.

If this does not answer your question, be a little more specific.

hope this helps.
 
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