Click here to Skip to main content
15,888,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to create my first database in visual studio 2012 but it keeps giving errors along the lines of "provider: named pipes provider error: 40 - could not open a connection to the sql server". I suspect the error is arising because I'm not inserting a correct server name in the "Creat new SQL database" dialog box.

What I have tried:

The book I'm studying says to enter "(local)" in that box (which I have done). The only instruction of theirs I haven't followed is to download Microsoft SQL Server Express Edition but I couldn't because the file is too large for my bandwidth cost. Besides, from the download page, I can deduce it's a database management tool, not a server in itself. Moreover, in my programs and features i.e installed programs, I can find Microsoft SQL Server 2012 Express LocalDB. So isn't this the same program that got here because it ships along with visual studio (correct me if I'm wrong).

On a side note, I downloaded QueryExpress as it achieves the same aim with a lesser size which probably proves my problem isn't related to db management tools.

From this page File Locations for Default and Named Instances of SQL Server | Microsoft Docs[^] I can see the folder 110 on my drive. Then it says

During SQL Server Setup, an instance ID is generated

Is this setup only done when the 266mb express edition is downloaded and run? Is there any other way to setup my server or get rid of the error? Why doesn't that server name field simply accept localhost? Every program logically accepts localhost so why is this different? Thanks.
Posted
Updated 14-Nov-17 13:56pm

1 solution

Well, if you have SQL Server Express installed already, the server name would just be ".\SQLEXPRESS".

Don't know if you have it installed? Open "Programs and Features" or "Apps and Features" depending on the version of Windows, and look for "Microsoft SQL Server version Express LocalDB". That's the database engine.

QueryExpress is NOT a database engine. It's a query tool used to run queries against a database engine. It's going to want the exact same information Visual Studio wants.
 
Share this answer
 
Comments
nmeri17 15-Nov-17 2:30am    
It didn't work for me. I'm now getting error 26 error locating server/instance specified. I tried the following server names: .\SQLEXPRESS, (local)\SQLEXPRESS, (localhost)\SQLEXPRESS, .(localhost)\SQLEXPRESS. None worked. But I've looked up a number of threads and discovered I need to have something like SQL SERVER (MSSQLSERVER) in my running services. Presently I have nothing of such likeness in my services. The closest to it is SQL SERVER VSS Writer. So this other parts which are obviously missing, how do I go about getting them?
Dave Kreskowiak 15-Nov-17 8:02am    
SQL Express doesn't run as a service. The full SQL Servers do.

I already told you where to look to see if SQL Server Express is installed.
nmeri17 16-Nov-17 18:49pm    
I wrote this in the original post "Moreover, in my programs and features i.e installed programs, I can find Microsoft SQL Server 2012 Express LocalDB. So isn't this the same program that got here because it ships along with visual studio (correct me if I'm wrong).". Thanks for trying to help anyway
nmeri17 16-Nov-17 18:53pm    
I haven't setup the server before. Don't I need something like an installer or something to trigger the setup to a point where I'm given an instance ID, which I can then use in place of the local\sqlexpress you suggested?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900