c# - reflecting changes made to the datagrid back on the dataset and the datatable -


I have a datagrid that has a dataset and its dataset is a table from the database in the dataset. I need this when I change the cell values ​​in the datagrid, the changes should reflect back on the database. The thing is that these changes appear on the dataset, but when I use da.Update (ds, "TableName") to forward that change to the database, it does not work. Datagrid still shows the old value, although the datagrid and dataset shows the update value. I have used the da.Update () command at other places in the same program twice and it starts working properly and the database shows updated values. I do not know Watts who does not work at the moment. The surprising thing is that I am not getting any errors, the code runs properly, but no changes have been noticed in the database. Edit

Edit: In fact, what I am doing is selecting a line from a data grid and then displaying all the text values ​​from that line on the text box. I am doing So I am editing those values ​​and saving them using foll using the code

Private zero btnSave_Click (Object Sender, EventArgs e) {dgDetails.SelectedCells [0] .Value = txtPurpose.Text; Da.Update (DS, "Scheduler"); }

There is no solution to any problem ????

Are you using the same data adapter for both Fill and Update method calls? I believe that for the most part you have to call the filling and updating with the same data adapter.

Also, make sure that you are not making an acceptable changelog before making an update call. Accept change will change status of dataset to unchanged. You have a good example to complete on


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -