Link to home
Start Free TrialLog in
Avatar of ndingle
ndingleFlag for United States of America

asked on

Named Pipes Provider, error: 40 - Could not open a connection to SQL Serve

I have a new application that is connecting to SQL 2005. Every time I run I get the following error:
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)

Application is Vb.net running on an XP box. SQL 2005 is developer edition running on the same box.
The funny thing is that if I run a different application and point it to the same database everything works fine. The code that access the database is the same on both applications.
I have never had any problem getting to SQL on any other application. I have verified that the connection string is correct. The new application also referenced Oracle client, so I thought that might be a problem. I remove all references to the Oracle client and the app still fails.

Any help would be appreciated. This has been haunting me for 2 days.
ASKER CERTIFIED SOLUTION
Avatar of Cedric_D
Cedric_D

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ndingle

ASKER

The connection strings are the same in both applications. This has been verified in debugger. I am using SQL authentication for both applications.

I am not sure how to disable named Pipes, but will give it a try.
Avatar of ndingle

ASKER

I enabled TCP/IP and shared memory, disabled named Pipes. Still have the problem.
Avatar of Cedric_D
Cedric_D

You have Accepted soluton - but still have a problem?

Do you guarantee both connection strings are 100% equal?
Maybe, one use (local) as server, and second PCNAME?

Do you see: (provider: TCP/IP Provider, error: 40 - Could not open a connection to SQL Server)?

Try write "PCNAME,1433"  (this will force to use TCP/IP with specified port)

Avatar of ndingle

ASKER

I did not get the Named pipes turned off as I thought. It solved the problem
Thanks