View Single Post
 
Old January 5th, 2006, 10:05 PM
Michaniker Michaniker is offline
Registered User
 
Join Date: Dec 2005
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After upgrading an ASP.NET 1.1 application to ASP.NET 2.0, my Windows XP Pro computer had the following symptoms:

1. After launching Internet Explorer 6.x, and typing the address http://localhost/, this error message was produced:

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: 40 - Could not open a connection to SQL Server)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 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: 40 - Could not open a connection to SQL Server)

2. After selecting Start>Run> and typing cmd to get a command window, the SQL Server command “osql –E” produced the following error message:

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.
Named Pipes Provider: Could not open a connection to SQL Server [2].


I spent 6 hours of googling and researching in the attempt to restore the .NET functionality I enjoyed before the upgrade. Microsoft’s “Named Pipes Provider” error really threw me into a troubleshooting course I shouldn’t have had to travel down. Enabling "Pipes", under the SQL Native Client Protocol, was not the answer. Neither was deinstalling and reinstalling SQL Server 2005 Express or sacrificing a farm animal. I finally figured out the solution. The DBConn setting in IIS 5’s ASP.NET Configuration tab for the web site instance was somehow set incorrectly, by either the IIS 5 or ASP.NET 2.0 software applications, or so one could assume. I can assure you it was not directly changed by this author. If you have either symptom, as described above, take the following steps:

Right-click on My Computer
Select Services and Applications
Select Internet Information Services
Select Web Sites
Right-click on the web site name and select Properties from the contextual menu
Select on the ASP.NET tab
Click the Edit Configuration button
When the ASP.NET Configuration Settings popup window appears, ensure the General tab is selected.
In the Application settings area, ensure the DBConn value matches the DBConn string settings in your .NET application’s Web.Config file. If it doesn’t, highlight the DBConn setting and choose the Edit button to correct this.

**********Warning**********
If you take these steps to recover from the dreaded “Named Pipes Provider” sucker-punch, ensure you maintain a copy of your Web.Config file. After the above steps were taken, I found my Web.Config file had been stripped of all as well as minor tweaks in the coding to such an extent that the application refused to run until I restored the Web.Config file to its original condition.

Hope this helps,

Steve Gilley
aka Michaniker