0
You can use the following.
//Begin Transaction
SqlTransaction trans = conn.BeginTransaction("RemoveProducts");
try
{
//Delete Product
SqlCommand cmd = new SqlCommand("", conn, trans);
cmd.CommandText = "Delete from Products where ID=5";
cmd.ExecuteNonQuery();
trans.Commit();
}
catch(SqlException sqlex)
{
transs.RollBack();
}