Q:

SQL Server Connection Issue - I can connect but other users can't

[edit] so not sure what happened, but we ended up resetting the server and turning off/on TCP/IP and Named Pipes and after a restart and updating the settings everything started working again. weirdest thing. anyways thanks for the help guys. 
I'm building a C# WPF application for my job, and I'm getting a weird problem that I've been trying to figure out for the past week. The application connects to the server and imports several tables on start up. So I built it out and was testing it with no issues, but when i pass it to our testers, and everyone is getting the following errors:

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

The users are able to connect to the server through other methods (SSMS/Excel VBA), but just through the application it won't work. 
I've checked the following:

Remote connections enabled
TCP/IP connections enabled
Firewall settings are the exact same across all users (me included)
application is compiled as 32 bit (saw this in another thread)

We're using SQL Server 2008 and I've tried several connection strings/methods.
below is the code I'm using to connect:
 public void Open_DB_Conn(string Connection_Str)
 {
        try
        {
            Sql_Conn = new SqlConnection(Conn_Str);
            Sql_Conn.Open();
        }
        catch (Exception e)
        {
            MessageBox.Show(string.Format("Error Message:{0} Conn String: {1}",e.Message,Conn_Str));
        }
    }

Below is my connection string (this is just one of many iterations I've used trying to get it working):
Data Source=IP Address;Initial Catalog=DB_Name;User ID=LOGIN;Password=PWD

Anyone know why I would be the only one able to get it to work and that the users are able to login to the server using other applications without a problem? They use it for logging their excel VBA scripts and there aren't any issues there. 

A:

Try this - it may be your answer 
"The error is reported by client library. While your server is listeing on remote TCP, client will still try TCP and NP connection in order. So the error client behavior is expected. From what you have described, I believe that even though you enabled the remote TCP connection on the XPSP2 machine, you didn't make the TCP listening port an exception of XPSP2 personal firewall. You should follow steps below to resolve this issue.

check the SQL Server Errorlog to make sure SQL Server is now listening on TCP/IP and confirm which port it is listening on.  Usually 1433.  In the Errorlog, you will see several lines that discuss what SQL Server is listening on. Below is an example:
2006-01-04 01:41:07.65 server    SQL server listening on 10.254.1.150: 1433.     <--Shows the IP Address and the port.
2006-01-04 01:41:07.65 server    SQL server listening on 127.0.0.1: 1433.          <--Shows another IP Address and the port.
2006-01-04 01:41:07.69 server    SQL server listening on TCP, Shared Memory, Named Pipes.
2006-01-04 01:41:07.69 server    SQL Server is ready for client connections             

2, Make sure on Windows XP that the firewall is not blocking that port.
3, go to your client machine and run the client network configuration tool (cliconfg.exe)  Make sure TCP/IP is enabled, click properties and make sure the port number is the same one as SQL Server is listening on. Here you can enable NP or disable client NP as well.
Once both the client and the server are using TCP/IP with the same port number and the firewall on server machines is not blocked, you should be able to connect.
Hope this helps."
(Ref: http://social.technet.microsoft.com/Forums/sqlserver/en-US/c488cf76-2515-440f-b3f8-9cfad689c5b6/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server?forum=sqldataaccess)

