Enabling User for Distributed Transaction
The Connection object will automatically close in the existing one if it determines that the transaction is active. Automatic transaction entry occurs when a connection is open or retrieved from the connection pool. You can disable automatic recruiting in existing transactions by specifying Enlist=false
as the connection string for SqlConnection or OLE DB Services = -7 as the connection string parameter for OleDbConnection.
Note The connection must be open
before calling EnlistDistributedTransaction
.
Below is an example for Enlist=False;
source share