Sql-server – Unable to connect SQL Server 2012

sql serversql-server-2012

I am facing an issue in connecting to SQL Server 2012 with a .net application. SQL Server 2012 database and code are deployed on the same server.

Connection string:

<add key="umbracoDbDSN" 
     value="server=test.test.com;database=testumbraco;user id=testumbraco;password=testumbraco" />

Localhost:

<add key="umbracoDbDSN" 
     value="server=localhost;database=testumbraco;user id=testumbraco;password=testumbraco" />

I tried same credentials with SQL Server Management Studio 2012/2014 and these are working fine locally and from remote machine.

Error:

The network path was not found

Create a second test virtual directory:

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)

Please advise

Best Answer

If you haven't verified that Named Pipes is enabled on the SQL instance, do this: Open SQL Configuration Manager, usually found in Start > Microsoft SQL Server 2012 > Configuration Tools (in Server 2008/R2. If using Server 2012, just search for it with WinKey+S) Go to SQL Server Network Configuration on the left. Open Protocols for . Right-click Named Pipes if it's disabled (will be red) and choose Enable.

.Net seems to require named pipes (and your error above mentions it). There are probably other ways to connect that would not require this.