I have a problem inserting some data into a linked server. I'm getting the error message that appears on the title of the question.

  1. I have tried to set the Local DTC properties

enter image description here

  1. I have tried to set the Enable Promotion of Distributed Transaction to False

enter image description here

It doesn't resolve the problem.

The interesting part is that if I create a new connection in the code to the database and use the Enlist=false it works

enter image description here

If I remove the Enlist=false from this connection in the code, it gives the same error, related to a distributed transaction. The problem is that I would like to resolve this using the connection string from the web.config file, and I thought that if I added this Enlist to the web.config connectionstring it will work, but although the connection string is modified to use this Enlist=false parameter, I get the error

 <add name="" connectionString="..........Enlist=false;multipleactiveresultsets=True;application name=EntityFramework&quot;" providerName="System.Data.EntityClient" />


 The operation could not be performed because OLE DB provider for linked server was unable to begin a distributed transaction.
 OLE DB provider for linked server returned message "No transaction is active.".

Any help is appreciated!

0

There are 0 best solutions below