{
DeleteOrders();
DeleteCustomers();
AddNewCustomers();
AddNewOrders();
updateTransaction.Complete();
northwindDataSet.AcceptChanges();
}
}
The order for reconciling changes to related data is as follows:
-
Delete child records (in this case, delete records from the
Orderstable) -
Delete parent records (in this case, delete records from the
Customerstable) -
Insert parent records (in this case, insert records in the
Customerstable) -
Insert child records (in this case, insert records in the
Orderstable)