Problem in upgrading from .Net 2.0 Beta to .Net 2.0 Professional

B

Beenish Sahar Khan

Hello,
I am developing an application in C#, which was previously in .Net 2005
Beta, then it was working perfectly fine, but from the time I have upgraded
it to .Net 2005 Professional, its continously giving me error on the
following line,
transaction = Connection.BeginTransaction();


System.Data.SqlClient.SqlException: New transaction is not allowed because
there are other threads running in the session.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at
System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[]
buffer, TransactionManagerRequestType request, String transactionName,
TransactionManagerIsolationLevel isoLevel, Int32 timeout,
SqlInternalTransaction transaction, TdsParserStateObject stateObj)
at
System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest
transactionRequest, String transactionName, IsolationLevel iso,
SqlInternalTransaction internalTransaction)
at
System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(TransactionRequest
transactionRequest, String name, IsolationLevel iso, SqlInternalTransaction
internalTransaction)
at
System.Data.SqlClient.SqlInternalConnection.BeginSqlTransaction(IsolationLevel
iso, String transactionName)
at
System.Data.SqlClient.SqlInternalConnection.BeginTransaction(IsolationLevel
iso)
at System.Data.SqlClient.SqlConnection.BeginDbTransaction(IsolationLevel
isolationLevel)
at
System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction()

Any kind of help would be welcome.
regards,
Beenish Sahar Khan
 
D

David Sceppa [MSFT]

Could you provide a little more background on what the code is doing?
It sounds like you may have an open SqlDataReader on the connection, or
perhaps a SqlCommand that you're executing asynchronously.

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2005 Microsoft Corporation. All rights reserved.
 
B

Beenish Sahar Khan

Yes David, you are right, we had an open DataReader, We are clsoing them
now, and its working perfectly fine now. Kevin Yu of MSFT has also pointed
this cause, you ppl. really know your stuff, thanks very much for your
reply :).
 
D

David Sceppa [MSFT]

No problem. I'm happy to hear you and Kevin were able to determine
the cause of the problem. Happy programming!

David Sceppa
Microsoft
This posting is provided "AS IS" with no warranties,
and confers no rights. You assume all risk for your use.
© 2005 Microsoft Corporation. All rights reserved.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top