What is the method for updating the SQL table from a bound control?
I have a checkbox control on a Windows form. The control is bound to a SQL dataset column as a Boolean. The value from the database is displayed correctly. When the check state is changed and the dataadapter update method is called (after accept changes on dataset is called), no changes are made. When a dataadapter.fill is executed after the update, all original values are returned. No errors are generated. What is the method for updating the SQL table from a bound control? Setting the row and column data manually and the calling update also does nothing. The table only has one row of data.
You should NEVER call AcceptChanges on the dataset! It's exactly THAT method call that is telling the adapter later that there are no changes. The method is called automatically by the adapter upon successfully applying the update.
This was first published in November 2003