using System.Data.SqlClient; using System.Transactions; using (TransactionScope scope = new TransactionScope()) { using (SqlConnection connection1 = new SqlConnection(connectionString1)) using (SqlCommand command1 = connection1.CreateCommand()) using (SqlConnection connection2 = SqlConnection(connectionString2)) using (SqlCommand command2 = connection2.CreateCommand()) { connection1.Open(); command1.CommandText = "UPDATE table1 SET column1 = 1 WHERE id = 1"; command1.ExecuteNonQuery(); connection2.Open(); command2.CommandText = "UPDATE table2 SET column2 = 2 WHERE id = 2"; command2.ExecuteNonQuery(); } scope.Complete(); }This code creates a new transaction using a TransactionScope, and then performs two separate SQL update operations on two different databases. The Complete method must be called on the TransactionScope in order for the transaction to commit. The System.Transactions namespace is part of the .NET Framework Class Library, which is included as part of the .NET Framework.