Click here to Skip to main content
12,765,176 members (36,900 online)
Rate this:
Please Sign up or sign in to vote.
I have a windows form that connects to SQL just fine on about 5/10 PC's but on the other pc's i get the following error:
System.Data.SqlClient.SqlException (0x80131904): 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)

I've been searching for ways to resolve this but I'm not really sure what to do.

Let me know if any other information is needed.

Please Help!!
Posted 7-Dec-12 9:20am
Updated 7-Dec-12 9:32am
Zoltán Zörgő 7-Dec-12 15:58pm
And what is the common difference between those PCs, that can connect and those that can not? First of all, I suggest you check with Sysinternals's PROCEXP ( to see where the TCP session is failing. If these PCs are on the same network, it is possible to be a firewall issue...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This technet article How to Troubleshoot Connecting to the SQL Server Database Engine[^] might help you troubleshoot the problem.
Dustin Prevatt 7-Dec-12 15:02pm
Thanks, I have tried those steps before and still can't connect.
Dustin Prevatt 11-Dec-12 10:26am
Turns out this was a dns issue on my end. Thanks for the help!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 7 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100