Home SQL Protocol Named Pipes is disabled but still periodically getting error "Named Pipes Provider error: 40 - Could not open a connection to SQL Server"
Reply: 0

SQL Protocol Named Pipes is disabled but still periodically getting error "Named Pipes Provider error: 40 - Could not open a connection to SQL Server"

user1596
1#
user1596 Published in April 23, 2018, 9:25 am

I am using a default connection string in a .NET application , not specifying any protocol e.g

<add name="TestConn" connectionString="Data Source=1.1.1.2;Initial Catalog=testDB;MultipleActiveResultSets=True;Persist Security Info=False;User ID=sa;Password=1234; " providerName="System.Data.SqlClient" />

Every so often the error below is logged from the application,

"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)"

But on the next connection attempt it continues working as normal connecting successfully. (assuming via TCP)

In SQL Server Configuration Manager under SQL Server Network Configuration Named Pipes is disabled, Shared Memory and TCP/IP are enabled. So why is it even attempting to connect using named pipes ??

The application and SQL server are not on the same machine and i am using the IP address so shared memory shouldnt be used either , so from what i can tell connections should be defaulting to TCP

I dont want to just specify the port in the connection string e.g Data Source=1.1.1.2,1433 or Data Source=tcp:1.1.1.2;

I am trying to understand why its making these attempts?

Am using SQL Server 2008 R2 and a .NET 3.5 console application

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.701589 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO