SQL Network Interface Error 52

c# database entity-framework-6 sql-server

Question

Im am working with EF6 Code First. The Application I am writing is a Server which manages logins and these logins a stored in a Database.
I used the Database Migration but I never specified a connection string because I want to be able to set the string during runtime. When I ran the update-database command I used the -script version.
Now the problem is that on my Developing machine everything works fine. I start the Server specifiy my Developing database and it connects just fine, also if I specify the database on the remote server where it will be published it connects. But as soon a I move the Executable to the server and try to connect to this servers local Database it gives me the following error:

Netzwerkbezogener oder instanzspezifischer Fehler beim Herstellen einer Verbindu ng mit SQL Server. Der Server wurde nicht gefunden, oder auf ihn kann nicht zuge griffen werden. Überprüfen Sie, ob der Instanzname richtig ist und ob SQL Server Remoteverbindungen zulässt. (provider: SQL Network Interfaces, error: 52 - Es k onnte keine Installation der Laufzeit der lokalen Datenbank gefunden werden. Übe rprüfen Sie, ob SQL Server Express richtig installiert und die Laufzeitfunktion der lokalen Datenbank aktiviert ist.)

English: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled)

I have checked the Connection string which is valid.
I do not think it is due to Firewall/Tcp missconfiguration since i can connect from another machine with the very same Executable to the same Database
And this is exactly what throws me for a loop. How can I not connect localy but remotely ?
Also the Server is running a SqlServer Enterprise x64 edition
This issue exists since I did the Migrations. So idk if it is somehow connected.
I looked through some forums but all I found were the usual things about connection Strings and Firewall configuration.

The problem is I dont know how to Troubleshoot this.

1
0
8/17/2015 2:12:09 PM

Accepted Answer

I am not sure how the exact relationship ist but I was able to resolve this issue. I used the MigrateDatabaseToLatestVersion initializer and apparently this was the problem I now changed it to CreateDatabaseIfNotExists initializer and it works fine.

0
8/17/2015 2:58:52 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow