Howdy
I have a form in my application which has 7 textboxes. In the constructor of the form I run the method "MakeText()" that inserts values from a MySqlDataReader into the textboxes.
The user can change the values in those textboxes and when a "submit" button is clicked it will run an update query on the database to write all the changes made.
This is all fine, but I find it a waste of resources to be querying the database even if the user didn't change any of the text in the textboxes.
So I need some way to check if the user changed any of the values in the textboxes after the form was loaded.
I'd like to do this on the application level instead of letting the database handle it.
How can I do this?
EDIT: I just thought of this. Maybe I could put all the values into class strings when the form loads and then just check against that before running the query. Sometimes you just need to put a question into words to think of the answer :D
That's the best I could think up anyway...
You could store the initial value in the .tag value of the textbox then just do a comparison between current text and the tag text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With