How to make Dataset only saved affected rows (reproduced)

zhaozj2021-02-16  65

// Check for changement first.

// First use the Haschanges method to detect the affected line (Return Bool)

IF (! myDataSet.Haschanges (DATAROWSTATE.MODIFIED) RETURN;

// Create a temporary DataSet

DataSet XDataSet;

// Use the DataSet's getChanges method to get the affected row

XDataSet = MyDataSet.getChanges (DataRowState.Modified);

// Detect DataSet Error

IF (xDataSet.haserror) {

Throw New Exception ("Error Message!");

}

// Use the data adapter to update the DataSet;

MyoledBDataAdapter.UPdate (xDataSet);

转载请注明原文地址:https://www.9cbs.com/read-15551.html

New Post(0)