locked
Cannot Connect to the Database RRS feed

  • Question

  • Hi All

    I have my application running in IIS on my work station and the Database installed on another workstation(not a sever). Now when i run the application i get the error

    "provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server"

    however when I run the application from the VS2005 the application is running fine.It is just when i use the application from IIS that I m facing this problem.

    I have tried out solutions from a lot of articles that i read on this forum, however things are still not working for me.

    Also when i connect to a database which is on a server, m able to run the application properly. and I have no clues of the reason.

    Thanks in Advance for the help.
    Monday, December 17, 2007 1:47 PM

Answers

  • Steps for Configuration Manager:

    Make Browser service automatic from Manual in SQL Server 2005 services

     

    Go to Network Configuration in Configuration Manager

    Enable TCP/IP

    Enable Named Pipes

     

    Surface Area Configuration tool steps:

    Go to Surface Area configuration for services and Connection

    In Database Engine click on Remote Connection

    In there change to Local and Remote

    And choose both TCP/IP and Named Pipes it is the last option.

     

    When you have finished the above configuration you still need to add the Asp.net account in the box running IIS to SQL Server on two levels in Management Studio in the database security section and in the Management section so Asp.net have permissions in SQL Server.  The reason there are two permissions in SQL Server one for the server and one for the database you need to give both permissions to Asp.net to run your application in two boxes.  You are having double hop problem Microsoft have covered the issue and some solutions below.

     

    http://blogs.msdn.com/nunos/archive/2004/03/12/88468.aspx

    Monday, December 17, 2007 2:55 PM