Not connceting to remote sqlserver through IIS

Discussion in 'ASP .Net' started by Reddy, Jan 29, 2008.

  1. Reddy

    Reddy Guest

    When I create an websit in VS2005 and run it then it is running on the port
    and it is connecting to remote sqlserver. But when I create Virtual directory
    in IIS and try to run my website it is not connecting to remote sqlserver. i
    am getting 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)

    Can any one help me in this?
     
    Reddy, Jan 29, 2008
    #1
    1. Advertising

  2. Hi Reddy,

    Are you connecting to IIS hosting ASP.NET 2005 and SQL Server 2000 ????

    --
    Thanks,
    Sanket Sirotiya
    ()

    "Reddy" <> wrote in message
    news:...
    > When I create an websit in VS2005 and run it then it is running on the
    > port
    > and it is connecting to remote sqlserver. But when I create Virtual
    > directory
    > in IIS and try to run my website it is not connecting to remote sqlserver.
    > i
    > am getting 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)
    >
    > Can any one help me in this?
    >
    >
     
    Sanket Sirotiya, Jan 29, 2008
    #2
    1. Advertising

  3. Reddy

    Norman Yuan Guest

    You need to make two things sure:

    1. The SQL Server on other computer is accessible (it seems so, since you
    can connec to it when run the web app from VS);
    2. Which user account is running your web application/IIS. As web app
    developer, you should know it and configure the web app runs under
    appropriate user account according to security/business requirement. Then
    you can tell if the user account has permission to access SQL Server in the
    other computer or not. I guess this is where your problem is.

    When you run your app inside VS, it is very likely (especially when you use
    VS built-in web server), the web app is runing with the identity of your
    user account, which has access to the SQL Server. When you move your web app
    to IIS (in which computer), depending on how you configure the web app's
    security (Windows authentication? Anonymous access? Impersonate?...), the
    web app may very likely run as a user account (ASPNET or Network Service, by
    default) that does not have access to SQL Server or network resources.

    So, you need to ask your self: which user account is used? does it have
    access to the SQL Server?


    "Reddy" <> wrote in message
    news:...
    > When I create an websit in VS2005 and run it then it is running on the
    > port
    > and it is connecting to remote sqlserver. But when I create Virtual
    > directory
    > in IIS and try to run my website it is not connecting to remote sqlserver.
    > i
    > am getting 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)
    >
    > Can any one help me in this?
    >
    >
     
    Norman Yuan, Jan 29, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kristofer Liljeblad
    Replies:
    0
    Views:
    609
    Kristofer Liljeblad
    Jun 30, 2003
  2. Matthew Louden
    Replies:
    3
    Views:
    5,947
    Sherif ElMetainy
    Nov 7, 2003
  3. Alex Callea
    Replies:
    4
    Views:
    504
    David Browne
    Nov 9, 2004
  4. =?Utf-8?B?SmVmZnJleQ==?=

    Upgrading ASP w/SQLserver 2000 to ASP.NET w/ SQLserver 2005

    =?Utf-8?B?SmVmZnJleQ==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    502
    sloan
    Apr 27, 2007
  5. ShilpaM

    changing local to remote sqlserver database.

    ShilpaM, Sep 29, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    133
    Manish Bafna
    Sep 30, 2007
Loading...

Share This Page