3

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 MS SQL's version, I tried all that is said within this : http://kbijayanta.azurewebsites.net/tag/localdbv12-0/ link.

Here is a look at my Control Panel and the SQL related programs I have :

enter image description here

What is a definitive solution for this ?

P.S. : I have not installed any packages/programs/applications relating SQL server. All this was pre installed with my VS 2013 installation!

UPDATE

Here is the screen capture of the errors in the Event Log : enter image description here

Abhishek Ghosh
  • 2,593
  • 3
  • 27
  • 60
  • Have you looked in the event viewer to see if there is any additional information there, per the error message? – Tim Jul 12 '15 at 08:33
  • Please look at my updated question ! and Please tell me what to look into Event Viewer ? – Abhishek Ghosh Jul 12 '15 at 08:36
  • What you posted is not the event viewer. Go to Control Panel -> Administrative Tools -> Event Viewer and then look in the Windows Logs -> Application to see if there are any errors logged there. – Tim Jul 12 '15 at 08:39
  • Without seeing the event log or the connection string, hard to guess - but maybe [this](http://blogs.msdn.com/b/gaurav/archive/2013/12/21/deployment-of-sql-express-localdb-on-iis.aspx)? .... or [this](http://stackoverflow.com/a/26267373/822637)? – sq33G Jul 12 '15 at 08:39
  • @Tim : I ll add the Event Log in a moment – Abhishek Ghosh Jul 12 '15 at 08:41
  • @Tim : Please look at the screen capture I added – Abhishek Ghosh Jul 12 '15 at 08:43
  • @sq33G : simply doing `localdb create "v12.0"` doesnt work for me or where should I write it ? I am simply executing that in Command Prompt! And also in the other solution where should I add `` ?? – Abhishek Ghosh Jul 12 '15 at 08:47
  • not sure where you're executing commands, do you have a connection string somewhere? Also - the screenshot is not too useful, how about the text of any one of the SQL errors? – sq33G Jul 12 '15 at 10:30
  • @sq33G : I ll add the text of the error and I have still not added any connection string yet . It doesnt allow me to add a DB how do I add the connectionString without it ? – Abhishek Ghosh Jul 12 '15 at 10:32
  • @sq33G : Please see the screen capture I have added – Abhishek Ghosh Jul 12 '15 at 10:36

2 Answers2

3

i am not sure about it but try this delete and recreate your LocalDB\v11.0 database! At the command prompt

sqllocaldb delete v11.0
sqllocaldb create v11.0
Vishal Shrestha
  • 354
  • 2
  • 10
2

Steps to connect LocalDB to Visual Studio Server Explorer

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 didn't work, use the Instance pipe name that you copied earlier. You can also use this to connect with SQL Management Studio.
7.Select the database on next dropdown list
8.Click OK!

This is a demo pic

you can get help from How to connect to LocalDB in Visual Studio Server Explorer?

Community
  • 1
  • 1
Vishal Shrestha
  • 354
  • 2
  • 10
  • I get the following error when I execute the 2nd command : `Start of LocalDB instance "v11.0" failed because of the following error: Error occurred during LocalDB instance startup: SQL Server process failed to start` – Abhishek Ghosh Jul 13 '15 at 12:52