Thread: ASP.NET/"The underlying provider failed on Open." when using transactions

"The underlying provider failed on Open." when using transactions

Here an explanation:


The problem is the entity framework automatically opens and closes a connection with each call to the database, thus when using a transaction, you are attempting to spread a transaction out over multiple connections which elevates to MSDTC.



Open the connection manually and close it when you are done. Then the framework will use only one connection for all your calls.


http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/3aa3942d-1b56-4030-8ea6-8d9734da4168/


And here possible solution:


http://msdn.microsoft.com/en-us/library/bb738698.aspx