System.Transactions.TransactionScope())
    {
        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 Orders table)

  • Delete parent records (in this case, delete records from the Customers table)

  • Insert parent records (in this case, insert records in the Customers table)

  • Insert child records (in this case, insert records in the Orders table)

相关文章:

  • 2021-06-01
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2021-08-09
相关资源
相似解决方案