7
I’m trying to use the TransactionScope
in C#, I am performing the tests with local bank, but every time I try to execute some method it returns me this Exception:
Partner transaction manager disabled its support for remote/network transactions. (HRESULT exception: 0x8004D025)
I’ve already activated the Distributed transaction coordinator in services and DTC Local in Component Services, without success.
Part of the code:
try
{
using (var trans = new TransactionScope())
{
while (contadorInicial <= contadorFinal)
{
Objeto.Codigo = contadorInicial.ToString();
_objController.Insert(Objeto);
contadorInicial++;
}
trans.Complete();
return true;
}
}
I have performed all the procedures but the same error keeps occurring, what can I do? (I am trying to perform these procedures on the work computer, and the computers are on a network that is controlled by the IT sector) I wonder if that’s why?
– Laerte
Yeah. The database server is on another machine?
– Leonel Sanches da Silva
No, it is a local instance of SQL Server.
– Laerte
There is an alternative to Transactionscope that I could use?
– Laerte
I’ll put it in the answer.
– Leonel Sanches da Silva
Thanks, it worked with Sqlconnection!
– Laerte