Master technical and career interviews with structured answers—short definition, real examples, pitfalls, and how to answer in 60–90 seconds.
cross multiple data sources (e.g., SQL Server and other databases). It simplifies transaction management by automatically handling the commit and rollback of transactions cross multiple resources. Example: using (Transac…
ADO.NET ADO.NET Core Tutorial · ADO.NET
cross multiple data sources (e.g., SQL Server and other databases). It simplifies
transaction management by automatically handling the commit and rollback of transactions
cross multiple resources.
Example:
using (TransactionScope scope = new TransactionScope())
{
SqlConnection connection1 = new
SqlConnection(connectionString1);
SqlConnection connection2 = new
SqlConnection(connectionString2);
connection1.Open();
connection2.Open();
// Execute commands on both connections
scope.Complete(); // Commit the transaction if everything is
successful
}