using (TransactionScope scope = new TransactionScope()) { // Perform database operations db1.SaveChanges(); db2.SaveChanges(); // Commit transaction scope.Complete(); }
using (TransactionScope scope = new TransactionScope()) { // Perform web service operations service1.Call(); service2.Call(); // Commit transaction scope.Complete(); }This example shows using the Complete method to commit a transaction that involves two different web services. Package/Library: System.Transactions.