Question about TransactionScope and DTC RRS feed

  • Question


    My Code :

    Code Snippet

    using (TransactionScope scope = new TransactionScope())
                        using (SqlConnection sqlConn = new SqlConnection(connStr))
                             sqlConn.Open(); //throw exception:The transaction has already been implicitly or explicitly committed or aborted

    //do delete,update






    My clientsystem is winxp sp2, dbserver is win2003


    Err: The transaction has already been implicitly or explicitly committed or aborted.

    Type: TransactionException
    Server stack trace:
       at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException)
       at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)
       at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
       at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
       at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)
       at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()


    Please help!


    I have enable "Network DTC Access", allow both "Inbound" and "Outbound" TM communication, set it to "No Authentication Required" in DTC


    I had been puzzled for servral days!

    I can't find the answer and read many-large-hurge topics and blogs!


    Help me,thk u!

    Friday, July 27, 2007 10:10 AM

All replies