C textbox not updating
Update, updates the Database with information in the Data Set. yes you are right i have set the breakpoint and when i press update button it will first go to the Page Load than on my update click but due to Is Postback it is not going in If Condition and directly pass to the update click event. My problem has been solved and even i understand it.
This is the problem Hello, I think you are retrieving the values from the database in Page_Load event..populating them in textboxes...
Is Post BAck)...will be fine as the code placed in that condition only executes for the initial request....
If this is not the exact answer..do post your code showing which event you are populating the textboxes...
Here are the code fragments for loading and saving the data: private void btn Edit_Click (object sender, System.
Event Args e) private void btn Save_Click (object sender, System. Any constructive help is much appreciated, Patrick Hello Patrick, The code snippets you've provided are OK.
I've read many posts concerning this (and the MS KB as well), and most seem to say that databound text boxes must use a Data Row object (in addition to connection, data adapter, and dataset objects), and therefore not as simple as a datagrid.
Based on what I've read, I'm inclined to believe that the book is wrong.
For example in place of age“28”, updated with “30” and in place of salary “50000”, updated with “55000”, then click button “Update”. Basically this:1)Form opens, text box has data in it from database (i.e."Test")2)I delete "Test" text from text box, and type in "Test2"3)I hit the submit button, and through a sqlcommand object update the data on the database from "Test" to "Test2"That is how I want it to work, but no matter what I try, all I get is the original data that got populated in the text box on load. This automatically updates the panel after that particular event from the control is being fired. I'm really sorry - if you post your code, I'd be happy to take a look and see if maybe another pair of eyes might be able to help figure out the issue. Tim The same can also be resolved by adding the control and the event caused to change the textbox, to the triggers (property of updatepanel) collection of the update panel.
If so then what's happening is that you when click submit to change the data, you're form is getting the old data from the database, and then, your btnupdate_click method is then executed. protected void Page_Load(object sender2, Event Args e2) protected void btnupdate_Click(object sender, Event Args e) you would need to call Update instead of Fill on the Data Adapter. Before giving Is Postback in my page load how come my update button click is taking the same value what i have retreived in Page Load.