Call the Update method on the DataAdapter to sync changes. Example: // Assuming you already have a populated DataTable DataTable table = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter("SELECT * FROM Customers", connection); // Set commands for Insert, Update, and Delete
dapter.UpdateCommand = new SqlCommand("UPDATE Customers SET
CustomerName = @CustomerName WHERE CustomerID = @CustomerID",
connection);
dapter.UpdateCommand.Parameters.Add("@CustomerName",
SqlDbType.NVarChar, 100, "CustomerName");
dapter.UpdateCommand.Parameters.Add("@CustomerID", SqlDbType.Int,
4, "CustomerID");
// Update the database
dapter.Update(table);
fter modifying the DataTable, the Update method pushes those changes to the database.