I encountered the following error while transitioning a .NET application from the development environment to the Integration test environment:
"An error has occured 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:40-Could not open connection to SQL Server))"
This had me stumped for a while as our application was using SQL Server 2000 as the database. After some googling, I found the following post by Richard Byham on DBForums that gave me the solution.
http://www.dbforums.com/showthread.php?t=1204986
The IT environment DB Server and the client machines had (for some strange reason) SQL Server Express installed. The SQL server 2000 installation on the server (which had the actual DB used by the application) was a named instance. Due to this, the client code was encountering problems in accessing the SQL Server. After uninstalling the SQL Server 2005 Express and reinstalling SQL Server 2000 as recommended in the post, everything started working again.
But it sure gave us a few tense moments before we figured this one out.