Aug 24 2007

How To Fix: Provider: Named Pipes Provider, error: 5 - Invalid parameter(s) found

Tag: sql server 2005, sql server 2000, .net, c#, asp.netpop @ 12:54 am

Are you coming up against this error, when connecting to SQL Server?

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 the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 5 - Invalid parameter(s) found

  • Here are the two biggest causes:
  1. You dont have TCP/IP enabled for this instance of SQL Server. In the SQL Server Configuration Manager (under Configuration Tools in the Microsoft SQL Server folder), you can change these settings.
  2. Your connection string is in the following format:

Server=\\MYSERVER\SQL2000;Initial Catalog=my_database;uid=sa;pwd=sa

The solution here is to drop the leading backslashes, ie. make this connection string:

Server=MYSERVER\SQL2000;Initial Catalog=my_database;uid=sa;pwd=sa