3

First of all, let me tell you that I have tried every damn thing by Googling to overcome this error and I have not done any TYPO error either. But, none of the Google results helped. Let me tell you the scenario... I installed Visual Studio Ultimate 2013 (and nothing else, no separate sqlexpress, nothing). All non-DB apps are working fine. But, for one project, when I tried to create new database connection (by right clicking 'data connections' or clicking 'connect to database' icon for creating localdb), I got this error:

"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: sqlnetwork interfaces, error 26- Error locating server/Instance specified)"

Then, as usual, I tried to Google for it. But most of the answers were related to sqlexpress (which I didn't installed separately). Then one answer was about "sqlserver configuration manager" and enabling sqlservices and something called surface area.... But, as "sqlserver configuration manager" was not there in my 'all programs' on my windows 8 (64x) machine, I downloaded sqlexpress and sqlserver management studio too. But an item named something like "surface area manager...." was not there. I enabled sqlservices, all tcp/ip ports. Shut down my firewall. Still getting the same error.

NOTE: I dont have any connection string in my webconfig till now because I was just going to create the new DB. So the the answer about editing conn string doesn't mattered to me.

NOTE: This was not the case with Visual Studio 2012. On only VS2012 (and nothing else) installation, it worked fine for creating the DBs and all other things. So, what's wrong with VS2013??

6
  • You need to either enable the protocols using SQL Server Configuration Manager or correct your DB connection string, or both. Search for the tool on your machine using the built-in OS search box. Commented Jun 20, 2014 at 20:26
  • Are you perhaps not connecting to the right SQL instance on the localhost? You can't connect to localhost if the instance is localhost\sqlexpress. You can use SQLCMD -L to list all instance names. Commented Jun 20, 2014 at 20:38
  • i got this on running above command in cmd... Microsoft Windows [Version 6.2.9200] (c) 2012 Microsoft Corporation. All rights reserved. E:\Users\Admin>sqlcmd -L Servers: ;UID:Login ID=?;PWD:Password=?;Trusted_Connection:Use Integrated Security=?; *APP:AppName=?;*WSID:WorkStation ID=?; E:\Users\Admin> "I dont know what the heck does it mean!" Commented Jun 20, 2014 at 20:45
  • stackoverflow.com/… Commented Jun 20, 2014 at 20:51
  • "sqlexpress (which I didn't installed separately)" - maybe install it now? Commented Jun 21, 2014 at 8:48

1 Answer 1

0

Server \ Instance name must be reachable from your client, as the creation of the connection string will try to verify that it connected OK. Try this from your workstation:

sqlcmd -Sservername\Instance_or_IPaddress_of_Sql_server -E -Q"select @@version"

Until you get a proper server name or instance, you will not be able to successfully create a db connection.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.