I developed a .net application that depends on a sql server database, the database was on the local machine used for development of the application.
When I moved the database to a remote machine and changed the connection string I got the following error:
An error has occurred while establishing a connection to the server when connecting to SQL server 2005, this failure may be caused by the fact that under default settings SQL server does not allow remote connection. ( provider: Named Pipes Provider, error: 40 – could not open a connection to SQL server. )
This error occurs only from XP machines but it works fine from Win. 7 Machines with the same connection string:
connectionString="Data Source=ot;Initial Catalog=sp_warehouse;User ID=fu;Password=bar"
I tried the following to troubleshoot the problem: - Disabled Named Pipes service from the server. - Added an exception in the server firewall for the SQL Server port 1433 - Disabled the firewall on the server completely - Added this parameter in the connection string: Network Library=DBMSSOCN;Persist Security Info=True
Each time I try something I get the same result, win. 7 machines work fine but XP machines don't.
Note: There's another application works from XP machines that uses another database on the same SQL Server and it's working fine.
Make sure the SQL Browser is enabled and running on your remote machine. You'll probably want to leave named pipes enabled.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With