Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8285341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:26:45+00:00 2026-06-08T11:26:45+00:00

I always get the error : A network-related or instance-specific error occurred while establishing

  • 0

I always get the error :

 A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to 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.

Now, I want to redirect my project to one page that show the message “We will back soon” or something else beside that error message that occurred.

Could anyone can tell me how can I do this in my asp.net mvc 2.0 project?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:26:46+00:00Added an answer on June 8, 2026 at 11:26 am

    You could use the Application_Error event in your Global.asax:

    protected void Application_Error()
    {
        var exception = Server.GetLastError();
        var sqlException = exception as SqlException;
        // See http://msdn.microsoft.com/en-us/library/cc645603.aspx 
        // for a full list of error numbers that you might be interested in
        if (sqlException != null && sqlException.Number == 2)
        {
            // it was a SqlException with error number = 2 meaning that this
            // is the exception that you wanted to handle => we redirect to some page
            Response.Clear();
            Server.ClearError();
            Response.Redirect("~/Offline.htm");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following PHP code for trigger creation but always get error, please
I always get this error when trying to compile my file with Boost::GIL PNG
I'm trying to get this running: JAXB interface But I always get the error
Whenever I try to open .pyc or .pyo files, I always get an error
Why do I always get the following error from Postgres? syntax error at or
When I try to do the select statement, I always get the following error:
Django's get_or_create function always cause get() returned more than one Model name error in
i have an instance of SQL server 2008 and an instance of SQL server
Why I always get WSAETIMEDOUT error in this code : var fUDPBuf: array [1..UdpPacketSize]
I need to connect to a SQL Server 2008 instance in another Windows domain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.