Problem in Dot Net 2005

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
 
F

Frans Bouma [C# MVP]

Beenish said:
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();

You already have a transaction running on Connection ? Do you share
Connection among threads? (for example in the asp.net application
object?))

Frans



--
 

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