4
How can I give RollBack()
in a transaction initiated in the declaration using
?
I know I can keep the transaction variable out of the using
of SqlConnection
, but it is possible RollBack()
using the using
?
My code
using (SqlConnection cnn = Geral.conexaoSql())
using (SqlTransaction tran = cnn.BeginTransaction())
{
_clienteBLL.ApagarCliente(cliente, cnn, tran);
tran.Commit();
}