Reputation: 245
I am having problems creating a Service Based Database on Visual Studio 2013 Community.
Basically, the problem is that when I attempt to add a Service Based Database to any of my projects I get an error message:
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: 50 - Local Database Runtime error occurred. Cannot create an automatic instance. See the Windows Application event log for error details)
In the past I have been able to add Databases to my projects without any issues. What has changed between now and then is that I started using SQL Server 2014 to work with a Java Project. I assume that installing SQL Server 2014 has changed some configuration settings that are now preventing me from creating a local database in Visual Studio.
I was able to resolve this by changing the name of the server (as configured in Visual Studio through Tools>Options>Database Tools>Data Connections) to SQLEXPRESS and was able to create a database, however, when I went to create a data source from the database, I got to the final step before I got the message:
Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=11.0.0.0, Culture=neutral, PublicKeyToken or one of its dependencies. The system cannot find the file specified
After downloading some files and installing them I saw no effects. I really still want to use a local database, and after trying to return back to using a local database I can't get anything at all to work. Now, no matter what I try I get the error message:
A network-related or instance-specific error occured while establishing a connection to SQL Server. The server was not found or wa not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
If I want to work with local databases in Visual Studio, can I do this with SQL Server 2014 installed? If so, is there anywhere that I am going wrong?
Thank you very much for any help you can provide.
Upvotes: 3
Views: 6770
Reputation: 1
Try running Visual Studio 2013 as administrator. It worked for me.
I found here ( A network-related or instance-specific error occurred while establishing a connection to SQL Server ) that the error is related with rights accessing databases.
Upvotes: 0
Reputation: 245
Ok so I managed to fix my problem.
To create a local database I had to use the SQL Server Instance name (localDB)\v11.0 and install 2012 LocalDB. It would appear as though installing SQL Server 2014 updated the 2012 version of LocalDB to a 2014 version, which Visual Studio 2013 is not compatible with.
I would thank everyone for the help, but there is no-one to thank.
Upvotes: 4