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 302425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:05:46+00:00 2026-05-12T07:05:46+00:00

I have an old .net 1.0 webapp that needs a bit of maintenance done

  • 0

I have an old .net 1.0 webapp that needs a bit of maintenance done on it. I’ve used the auto-upgrader to upgrade it to .net 3.5 (and also later tried 2.0) but now it can’t connect to the database.

On the surface this looks like a noob connection-string problem, but I’m thinking it’s more likely to be related to some subtle problem from the upgrade.

I get the generic 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. (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server)

The source code is pretty basic, with no bells or whistles:

protected static SqlConnection objConn;

objConn = new SqlConnection(strConnectionString);

try
{
    objConn.Open();
}

and also tried it as:

using (objConn = new SqlConnection(strConnectionString))
{
    objConn.Open();
    ...
}

The connection string comes from the web.config, and using the debugger to set a break point and look through the properties of the connection before it tries to open it, I can see that its found the connection string properly:

connectionString=”Data Source=XXX.XXX.XXX.XXX;Initial Catalog=XXXXXX;User ID=XXXXXX;Password=XXXXXX”

A handful of things I think I’ve ruled out:

The error message is the same whether connecting to Sql Server 2005 or Sql Server 2000.

No errors or warnings in the VS Error List.

The connection string is the same as a couple of other websites that also use the same database, so I know that the connection string is correct.

I’ve tried having it connect from my local computer (where I can connect to the databases via Sql Query Analyzer) and from the normal webserver, so it’s not a firewall issue, neither is it a max-connections issue.

It’s connecting to the server’s IP address, so its not a computer browser issue (and other webapps can connect fine.

TCP and named pipes are the 2 network protocols enabled on the sql server.

Adding “Network Library=DBMSSOCN;” to the connection string changes the error message to include “provider: TCP Provider, error” (there was something else I changed in the connection string the other day that also had that affect, but I can’t remember what now.)

I’ve already looked through 3 other similar posts on stack overflow:
(Can’t list links here because I’m a new user, but their question ID’s if someone else wants to link to them in a comment are: 63875, 1038888, 846479)
And this article on another site had some good ideas of things to try that didn’t help either:
http://weblogs.sqlteam.com/tarad/archive/2008/05/23/60609.aspx

My best guess is that its something caused by the upgrade between .net versions – maybe something wrong in the web.config?

It’s a C# app, pretty small/basic, but has been split into three projects.

  • 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-05-12T07:05:47+00:00Added an answer on May 12, 2026 at 7:05 am

    Write a console application that does nothing but try to connect to the database using the code you posted. Hard-code the connection string in the console program.

    In other words, remove all the distractions to make sure that the core code you are trying to run actually works correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an old style .NET ASMX (SOAP/XML) webservice that is used to upload
We have an old asp.net application that has no unit tests, integration tests, component
I have an old school ASP (note: not ASP.NET) web site that has a
I have a solution that has a plain old asp.net website and a winforms
We are porting our old Webapp from WebForms to MVC Asp.net , I have
We have old .net 1.1 project that is using a third party component. Aparently
I have an old .net 2005 web site that has some asp pages and
I have an old ASP.NET 1.1 site that I am maintaining. We are working
I have an old .net 2.0 windows app I need to deploy on a
I have in here an old web application written in ASP.Net 2.0 + AJAX.

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.