I am using a default connection string in a .NET application , not specifying any protocol e.g
<add name="TestConn" connectionString="Data Source=126.96.36.199;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=188.8.131.52,1433 or Data Source=tcp:184.108.40.206;
I am trying to understand why its making these attempts?
Am using SQL Server 2008 R2 and a .NET 3.5 console application