1
votes

Yes I know that this question has been asked many times, but this problem seems to be persistent.

I have had this error before but that was during hosting on IIS.For that reason I shifted from VS2013 to VS2010. There is no problem in VS2010, but I need VS2013 and now here I stand where I can't even add a DATABASE FILE.

Now here is the error which I am getting while adding a database :

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

Now I understand there is some error with the SQL Server's version, I tried all that is said within this : http://kbijayanta.azurewebsites.net/tag/localdbv12-0/ link.

What is a definitive solution for this ?

2

2 Answers

1
votes

Just don't copy paste question anyway if you want asnwer

  1. Open command prompt
  2. Run SqlLocalDB.exe start v11.0
  3. Run SqlLocalDB.exe info v11.0
  4. Copy the instance pipe name that starts with np:...
  5. In Visual Studio select Tools > Connect to Database...
  6. For Server Name enter (localdb)\v11.0. If it doesn't work, use the instance pipe name that you copied earlier. You can also use this to connect with SQL Server Management Studio.
  7. Select the database on next dropdown list
  8. Click OK!

Try this

delete and recreate your LocalDB\v11.0 database! At the command prompt type:

sqllocaldb delete v11.0  
sqllocaldb create v11.0
1
votes

I copied it but I got same error and thanks it worked for me perfectly

  1. Open command prompt
  2. Run SqlLocalDB.exe start v11.0
  3. Run SqlLocalDB.exe info v11.0
  4. Copy the instance pipe name that starts with np:...
  5. In Visual Studio select Tools > Connect to Database...
  6. For Server Name enter (localdb)\v11.0. If it doesn't work, use the instance pipe name that you copied earlier. You can also use this to connect with SQL Server Management Studio.
  7. Select the database on next dropdown list
  8. Click OK!