简体   繁体   中英

Visual Studio 2013 DB creation error : a network related or instance specific error occurred while establishing connection with sqlserver

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM