更新时间:2023-01-21 12:57:46
DataTable有一个名为GetChanges的方法,它返回在调用最后一个AcceptChanges后对表进行的所有更改。
请参阅此处 [ ^ ]更多
[代码示例]
DataTable has a method called GetChanges which returns all changes made to the table after the last AcceptChanges is called.
see here[^] for more
[Code sample]
private void UpdateDataTable(DataTable table,
OleDbDataAdapter myDataAdapter)
{
DataTable xDataTable = table.GetChanges();
// Check the DataTable for errors.
if (xDataTable.HasErrors)
{
// Insert code to resolve errors.
}
// After fixing errors, update the database with the DataAdapter
myDataAdapter.Update(xDataTable);
}