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.
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.