Click here to Skip to main content
13,457,828 members
Rate this:
Please Sign up or sign in to vote.
See more:
How can i update data in the textbox and then save them to the database.. by clicking a button "update".
before clicking that button.. textboxes should be uneditable.
after click the "modify" button textboxes become editable.. i change data and then with one "save" button the updated datas will be saved in the database
Posted 9-Nov-12 3:33am
joshrduncan2012 9-Nov-12 9:35am
What have you tried so far?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

When you load the form, set the text property of the textbox to the value of your field. Set the ReadOnly property of the text box to true. When the user clicks 'update', validate that they have permissions to change the field(s) and clear the ReadOnly flag on the one(s) they are allowed to edit.

When they click save, validate the new data and then save it back to your database. Optionally set the ReadOnly flag back to true to prevent further updates.

The database operations for lookup and update we will leave to you because it is dependent on how you are connecting. There are lots and lots of examples on here and Google for doing the DB CRUD operations for all the different connection methods.
Anusha SR 9-Nov-12 23:24pm
Google as 'Setting readonly property of textbox on button click' and 'Save vlue from textbox to database', that will help you for sure
Ahmed_online 10-Nov-12 13:53pm
first tell us about mode connection

connected or disconnected

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03-2016 | 2.8.180323.1 | Last Updated 10 Nov 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100