Browsing the archives for the entity framework tag

Transaction exception while using ADO.NET entities

in .NET Development, Uncategorized

The following ADO.NET code will throw following exception “New transaction is not allowed because there are other threads running in the session.”: The exception occurs because the foreach loop opens an transaction to query the order entities. The transaction stays open until the end of the loop is reached. To avoid this exception, just use […]