Monday, July 05, 2010

System.Data.SqlClient.SqlException: New transaction is not allowed because there are other threads running in the session.

I got this error when using Entity Framework with the following code.


Solution

The foreach loops were the culprits. I needed to call EF but return it into an IList of that target type then loop on the IList.

1 comment:

Dairo said...

I had the same error and with your solution it works now. Thanks!

Post a Comment