Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
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 4:33am
Comments
joshrduncan2012 at 9-Nov-12 9:35am
   
What have you tried so far?

1 solution

Rate this: bad
good
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.
  Permalink  
Comments
Anusha SR at 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 at 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
0 OriginalGriff 270
1 Sergey Alexandrovich Kryukov 185
2 BillWoodruff 173
3 CPallini 155
4 Kamal Rocks 144
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 10 Nov 2012
Copyright © CodeProject, 1999-2014
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