For Answers, see/post comments

Allow only one row to get updated in disconnected data access

To alter the default behavior of the DataAdapter object which does multiple-row changes to thedatabase, the following code updates only the first row modified to the database irrespective of any rows you changed.

sqlDataAdapter1.UpdateBatchSize = 1;

DataSet1 ds = (DataSet1)dataSet11.GetChanges();

sqlDataAdapter1.Update(ds);dataSet11.AcceptChanges();

MessageBox.Show("Only the first of the modified rows updated!");

sqlDataAdapter1.Fill(dataSet11);

No comments: