SQL Server Named Pipes Provider Error 40

by dcurtis 7/20/2008 7:10:00 AM

So, I had the following scenario at a customer:

  • They were moving a SQL Server 2000 database from one server to another
  • All of the references to connection strings in the application were updated to point to the new database
  • The data was moved from the old database to the new database and the old database was shut down

Everything seemed great; however, there was one ASP.NET 2.0 application that kept throwing 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 the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

 We scratched our heads for awhile on this.  We couldn't figure out why it was throwing a 2005 error when the database we were connecting to was 2000.  Further, we were absolutely positive that we had updated all of the connection strings...until I remembered that this application used a membership provider for authentication that was defined in the machine.config configuration file.  We updated the machine.config, and everything started to run without error.

Currently rated 3.0 by 5 people

  • Currently 3/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , , ,

IIS 6 "Down for Maintenance" Page

by dcurtis 7/18/2008 7:15:00 AM

I recently had a customer that needed a database moved from one server to another.  As part of the move process, the customer wanted a way to bring all of the sites down and display a "site is down for maintenance" page for all requests until the new database was up and running.  I wanted to have the solution be a catch-all for the site and all of the microsites on the server without having to do anything at the individual application level. 

After a search on the net I found a pretty good solution here that involves creating a new site on the server using the same IP settings, but a different application pool.  You stop the existing site, turn on the new site and voila--problem solved--right?  Well, not exactly.  It worked great if you went directly to the URL, but if you tried to reference a specific page, it displayed the 404 error page.  I tried to modify the Custom Errors in IIS for 404 errors to point to the same maintenance page; however, no matter what I tried, it didn't work (can someone explain why?) and I couldn't figure out a work-around.  I even tried to put a web.config file with a Custom Errors section to help perform the redirects; however, that didn't work either.

Finally, I thought, "If I can't point to the custom error page I want, why don't I just modify the existing 404 error page to look like the maintenance page?"  So, that is what I did--and it worked perfectly!  Now, I realize that won't work if you don't have access to the standard IIS help pages to modify them, but if you do, here is another option for you.  Hope this helps.  If you know of a better way...

Currently rated 3.3 by 6 people

  • Currently 3.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

IIS 6

Powered by BlogEngine.NET 1.3.0.0
Theme by Mads Kristensen

About the author

Derek Curtis Derek Curtis
President, Plaid Pony Technology Solutions LLC

E-mail me Send mail

Calendar

<<  November 2017  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Pages

    Recent comments

    Authors

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2017

    Sign in