none
SQL Server not found

    Question

  • Hi

    I have installed SQL Server web edition on windows 8 pro with IIS 8. The installation was successful. But when I try my ASP.NET website I get the following error.

     The network path was not found
    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.
    Exception Details: System.ComponentModel.Win32Exception: The network path was not found
    Source Error:
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:
    [Win32Exception (0x80004005): The network path was not found]
    [SqlException (0x80131904): 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)]
    
    Any Ideas? The SQL Management studio works fine because I have deployed my databases without any problem.
    Sunday, October 28, 2012 3:53 PM

Answers

All replies

  • Please use the right SQLserver Name to connect or in your connection string...

    for ex- if it is default instance then go to your cmd-type hostname then type the hostname in your connection string or connect through the SSMS.

    Incase of it is names instance then check your SQL browser is running fine without any issues and you need to connect to the SQL server instance through the  <SQLservername>\Named instance Name or ComputerName\InstanceName,<portnumber>

    or

    check your sql server services running fine without any issues or check Enable Remote Connection has been enabled for your sql server or

    check is there any firewall issue b/w your sql port .

    check the errorlog as well.


    Rama Udaya.K ramaudaya.blogspot.com ---------------------------------------- Please remember to mark the replies as answers if they help and un-mark them if they provide no help.

    Sunday, October 28, 2012 4:11 PM
  • Are you able to connect remotely (not from the local machine) to this instance through SSMS?  This sounds like a remote connection problem on the instance itself as opposed to an issue with your connection string.

    http://blogs.msdn.com/b/sql_protocols/archive/2008/04/30/steps-to-troubleshoot-connectivity-issues.aspx

    Things to check:  Is TCP/IP enabled on the instance?  Is SQL Browser server running?  Are firewall ports open to allow connection?  Is the instance configured to allow remote connections?  The article above walks through them all.

    Thanks,
    Sam Lester (MSFT)


    My Blog

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Sunday, October 28, 2012 4:14 PM
  • Hi Thanks for the replies. My situation is as follows:

    1. During installation I mostly chose defaults except few things.
    2. I am using a named instance.
    3. Mixed Mode authentication
    4. Allow remote connections

    As I said above I can connect to SQL Server through SSMS with windows authentication without any problem. In SSMS it reads:

    Server Name: machine_name\instance_name

    Login Name: machine_name\user_name

    My connection string in web.config is as follows:

    connectionString="Data Source=instancename;Initial Catalog=dbname;Integrated Security=True"
    
    SQL Server Browser and other services are running fine but I don't know how to connect to this server remotely?

    Before this I have been using SQL Server 2008R2 on Windows 7 Ultimate and IIS 7.5 without any problems.

    • Proposed as answer by vr.babu Monday, October 29, 2012 12:37 PM
    Sunday, October 28, 2012 4:37 PM
  • Did you forget the machine name?

    "Data Source=machine_name\instancename;Initial Catalog=dbname;Integrated Security=True"


    Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com

    Sunday, October 28, 2012 4:48 PM
  • Hi Thanks for the reply

    I have tried everything.

    Data Source=machine_name\instancename;
    Data Source=machine_name;
    Data Source=instancename;

    But no luck.
    How to connect to it remotely?

    Sunday, October 28, 2012 4:53 PM
  • Perhaps, a firewall issue?

    Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com

    Sunday, October 28, 2012 5:20 PM
  • Hi nice,

    The causes may be various:

    1.  Incorrect connection string.
    2.  NP was not enabled on the SQL instance.
    3.  Remote connection was not enabled.
    4.  Server not started, or point to not a real server in your connection string.
    5.  Other reasons such as incorrect security context.
    6. Check the firewall.

    Named Pipes Provider, error: 40 - Could not open a connection to SQL Server: http://blogs.msdn.com/b/sql_protocols/archive/2007/03/31/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server.aspx.

    TechNet Subscriber Support
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback here.

    Thanks.


    Maggie Luo

    TechNet Community Support

    Monday, October 29, 2012 1:58 AM
  • Hi Maggie, Thanks for the reply,

    By the way never had this problem before. As I mentioned above, I have been using SQL Server 2008R2 and IIS 7.5 on Win 7 Ultimate for quite some time. I always installed with defaults and no change to default installation. Didn't had to do anything afterwards as regards setting etc. Just deployed my databases and I was good to go. Since the release of Win 8 I was eager to see the new OS so removed everything, installed Win 8 Pro. I had SQL Server 2012 Web Edition and installed it but made a couple of changes to the installation as I said above, like used a named instance, instead of the default and enabled FILESTREAM and mixed mode  authentication.

    The only warning I received during the installation was that of firewall but windows firewall is disabled by Norton 360. I checked Norton 360 firewall as well. It is not blocking SQL server.

    So I really don't know what's wrong. The SQL server does not report any errors. The errors that are logged are those when I used User Id and Password in the connection string and the Error log says:

    2012-10-28 22:00:19.13 Logon       Login failed for user 'machine_name\username'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: <local machine>]

    Does it mean that SQL Server is accessible?

    The errors that my asp.net website reports are of two kinds:

    The first error was:

    The network path was not found

    Now the error is:

    The system cannot find the file specified 
      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. 
    
     Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified
    
    Source Error: 
    
     An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
    
    Stack Trace:
    
    [Win32Exception (0x80004005): The system cannot find the file specified]
    
    [SqlException (0x80131904): 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)]
    
    
    

    Now the error is : The system cannot find the file specified

    What are Named Pipes (NP) and how to tackle them?

    I am not an experienced programmer and SA just a beginner who is working on a website of his own, an asp.net website.

    Any ideas?

    Monday, October 29, 2012 7:28 AM
  • Hi nice,

    Any progress?

    Open SQL Server Configuration Manager and please enable TCP/IP and Named Pipe Protocol.

    If you have any problem, please feel free to let me know.

    Thanks.


    Maggie Luo

    TechNet Community Support

    Tuesday, October 30, 2012 4:45 AM
  • Hi Maggie, Thanks for the reply and I really appreciate your help, thanks again for checking.

    TCP/IP was enabled already and I also enabled Names Pipes but I think that was not necessary as described below.

    The situation now is as follows:

    1. Now I do not get that nasty "SQL Server not found" error, instead I get a failed login error for user 'NT AUTHORITY\SYSTEM'.
    2. I am unable to connect to the named instance of my SQL Server through IIS.
    3. However, I can connect to it through Visual Studio 2012 Development Web Server and I wonder why?

    The detailed error in the error log is as follows:

    2012-10-30 17:26:19.39 Logon       Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'dbname'. [CLIENT: <local machine>]
    

    What I have concluded so far is that the main problem is named instance and I am unable to connect to it through IIS. Had it been Default Instance...no problem. Because before this particular situation, I have been using default instance.

    Any ideas?

    Tuesday, October 30, 2012 12:30 PM