Safril Aulia Rahman
Safril Aulia Rahman

Reputation: 19

Cannot connect to sqlexpress

I just installed of SQL Server Management Studio Express 2012, and then I try to connect database engine with servername : ./sqlexpress, but it failed.

Its raised message like below :

TITLE: Connect to Database Engine

Cannot connect to ./sqlexpress.


ADDITIONAL INFORMATION:

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 3)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=3&LinkId=20476


The system cannot find the path specified.

Whats going wrong?

Upvotes: 1

Views: 6202

Answers (3)

matrixanomaly
matrixanomaly

Reputation: 6967

If anyone else gets a failed to connect to server instance while trying to connect to a DB in C#, make sure you add localhost to the front of your database server address if you're on the same machine.

ie: myDatabase2012 should be put in as localhost\\myDatabase2012 (the second \ is needed to escape the first)

Upvotes: 0

zombiehugs
zombiehugs

Reputation: 717

I've seen this in the past, most likely the wrong instance name or address. Since it is a local DB instance on your machine you will want to try connecting to (local)\SQLEXPRESS [This is the default SQL Express Instance]

Upvotes: 1

Thomas Fitzgerald
Thomas Fitzgerald

Reputation: 103

If you are running a local instance of SQL Server you can just use localhost as the server name. Also you can try to remove the ./ before the server name.

Upvotes: 0

Related Questions