Posted on 2006-03-27
Last Modified: 2008-02-01
Hi There

I have a asp web site that accesses some .Net Components.

When I try and access a component that uses a data connection I get the following error

.Net SqlClient Data Provider (0x80131904)
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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

I have resently update my .net Framework to 2.1

Can this have something to do with it

Question by:Stanton_Roux
    LVL 7

    Expert Comment


    maybe the update really causes the problem. I am not sure what gets updated actually.
    But here are a few points I would suggest checking...

    the message states that the target refuses the connection, so:

    (1) are running any firewall (hard / or software) that causes the problem?
    (2) are you in a domain and have no rights to access the server?
    (3) most probable: the component you are using runs in IIS, therefore probably got the User context of "ASP.NET user". this user is normally installed as local machine user and therefore has no rights to access a server on  a different IP.
    To solve this, you could either impersonate the component (like you are doing with your connections) or create a instance of the component in your security context.



    Author Comment

    1)I am running zone alarm personal firewall.

    2)The SQL server i am trying to access is on the machine that I am working on.

    3)I am accessing the site through through localhost so the user account should have rights.

    Author Comment

    I just checked in my User Acounts section and I see that the ASP.Net user account is not there

    Is there a way of adding that account
    LVL 7

    Accepted Solution

    1)I am running zone alarm personal firewall

    ok, any blocking messages on that log?

    2)The SQL server i am trying to access is on the machine that I am working on

    still could be that ZA locks that

    3) not sure if adding this user is enough.
    however, you can try it.
    UserName: ASPNET
    Pwd expires: never

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now