I was using an .mdf
for connecting to a database
and entityClient
. Now I want to change the connection string so that there will be no
context.Connection.Open()
didn't help solving my problem so I tried enabling "Allow Remote Clients" in DTC config, no more error.
In windows 7 you can open the DTC config by running dcomcnfg, Component Services -> Computers -> My Computer -> Distributed Transaction Coordinator -> Right click to Local DTC -> Security.
The SQL Server Express service were not set tostart automatically.
1) Go to control panel 2) Administrative Tools 3) Service 4) Set SQL Server express to start automatically by clicking on it 5) Right click and start the service
I hope that will help.
I posted a similar issue here, working with a SQL 2012 db hosted on Amazon RDS. The problem was in the connection string - I had "Application Name" and "App" properties in there. Once I removed those, it worked.
Entity Framework 5 and Amazon RDS - "The underlying provider failed on Open."
You could try to replace the metadata:
metadata=res:///conString.csdl|res:///conString.ssdl|res://*/conString.msl
to:
metadata=res://*/;
For me it was just a simple mistake:
I used Amazon EC2, and I used my elastic IP address in the connection string, but when I changed IP addresses I forgot to update my connection string.
I found the problem was that I had the server path within the connection string in one of these variants:
SERVER\SQLEXPRESS
SERVER
When really I should have:
.\SQLEXPRESS
For some reason I got the error whenever it had difficulty locating the instance of SQL.