Nell'oggetto Command è presente una proprietà che permette di impostare una transazione, inoltre la transazione può essere impostata direttamente nella creazione del comando come riportato qui sotto.
...
cn.Open();
SqlTransaction txn = cn.BeginTransaction();
string sSQL = "INSERT INTO Clienti (...) VALUES (...)";
SqlCommand cmd = new SqlCommand(sSQL, cn, txn);
int intRecordsAffected = cmd.ExecuteNonQuery();
if (intRecordsAffected == 1)
{
Console.WriteLine("Update succeeded");
txn.Commit();
}
else
{
//Assume intRecordsAffected = 0
Console.WriteLine("Update failed");
txn.Rollback();
}