private void UpdateDataSet(DataSet myDataSet){ // Check for changes with the HasChanges method first. if(!myDataSet.HasChanges(DataRowState.Modified)) return; // Create temporary DataSet variable. DataSet xDataSet; // GetChanges for modified rows only. xDataSet = myDataSet.GetChanges(DataRowState.Modified); // Check the DataSet for errors. if(xDataSet.HasErrors){ // Insert code to resolve errors. } // After fixing errors, update the DBMS with the DataAdapter // used to create the DataSet. myOleDbDataAdapter.Update(xDataSet); } Or See: ms-help://MS.NETFrameworkSDK.CHS/cpref/html/frlrfSystemDataDataSetClassGetChangesTopic.htm
// Check for changes with the HasChanges method first.
if(!myDataSet.HasChanges(DataRowState.Modified)) return;
// Create temporary DataSet variable.
DataSet xDataSet;
// GetChanges for modified rows only.
xDataSet = myDataSet.GetChanges(DataRowState.Modified);
// Check the DataSet for errors.
if(xDataSet.HasErrors){
// Insert code to resolve errors.
}
// After fixing errors, update the DBMS with the DataAdapter
// used to create the DataSet.
myOleDbDataAdapter.Update(xDataSet);
}
Or See:
ms-help://MS.NETFrameworkSDK.CHS/cpref/html/frlrfSystemDataDataSetClassGetChangesTopic.htm