How do I Update all the changes in a DataTable or DataSet object?
[top] You can send all updates in a DataTable or DataSet object to the database with the help of the CommandBuilder object. A CommandBuilder object helps generate all the changes in a DataTable or DataSet object into SQL statements that can be executed by the Command object. To update all the changes to SQL Server, use codes like the following example: da.Fill(ds, “tab1”); SqlCommandBuilder cb = new SqlCommandBuilder(da); ds.Tables[0].Rows[0][“username”] = “Modified Name”; da.UpdateCommand = cb.GetUpdateCommand(); da.Update(ds); 1.
Related Questions
- On a Purchasing Card transaction, if the department changes the object code from the default of PCRD to something more specific, does the DaFIS Direct Charge (DC) get marked as invalid?
- How do I Update all the changes in a DataTable or DataSet object?
- How can i save the changes to my DataTable in the test itself?