none
Error 25 :( RRS feed

  • Question

  • Named pipe is used to communicate with SQL server.

    Connection works when tested from the Visual Studio.

    Connection fails with error 25 when used by IIS from another machine in the same domain.

    Why?

    Configuration:

    • IIS 7 is on computer A
    • SQL 2016 Express is on computer B.
    • Visual Studio is on computer B as well.

    Connection configuration:

    <

    connectionStrings>

       

        <

    addname="PhoneBookConnectionString"connectionString="Data Source=\\B\pipe\MSSQL$SQLEXPRESS01\sql\query;Initial Catalog=&quot;Election Phone Book&quot;;Integrated Security=True;User Id=user_name; Password=user_password;"providerName="System.Data.SqlClient"/>

      </

    connectionStrings>

    Also, I've created on computer A an ODBC Source connected to the SQL Server on B. When I press "Test Connection" button in the ODBC configuration dialog it reports successful connection to the server.


    Tuesday, June 14, 2016 7:56 PM

Answers

  • Hi VictorZaslavsky,

    To create a valid pipe name, we need to do the following steps, please check if you do all the steps of below.

    1.Specify an Alias Name.

    2.Select Named Pipes as the Protocol.

    3.Enter the Pipe Name. Alternatively, you can leave Pipe Name blank and SQL Server Configuration Manager will complete the appropriate pipe name after you specify the Protocol and Server

    4.Specify a Server. For a named instance you can provide a server name and instance name.

    In addition, please try to modify the connection string like this:

     <add name="PhoneBookConnectionString"connectionString="Data Source=\\<change it as your remote IPAddress>\pipe\MSSQL$SQLEXPRESS01\sql\query;Initial Catalog=&quot;Election Phone Book&quot;;Integrated Security=True;User Id=user_name; Password=user_password;"providerName="System.Data.SqlClient"/>

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, June 17, 2016 6:44 AM
    Moderator

All replies

  • Hi VictorZaslavsky,

    According to your description, it seems that you use Named Pipes to Connect the database, if you connect your from another machine, From the following article, we know the Microsoft Windows Firewall closes port 445 by default. Because MicrosoftSQL Server communicates over port 445, we need to reopen the port if SQL Server is configured to listen for incoming client connections using named pipes. For information on configuring a firewall, see "How to: Configure a Firewall for SQL Server Access" in SQL Server Books Online or review your firewall documentation.

    #Creating a Valid Connection String Using Named Pipes

    https://technet.microsoft.com/en-us/library/ms189307(v=sql.120).aspx

    #Configure the Windows Firewall to Allow SQL Server Access

    https://msdn.microsoft.com/en-us/library/cc646023.aspx

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 15, 2016 1:57 AM
    Moderator
  • Hello Cole,

    Thanks for your reply.

    I've opened port 445 in the firewall. Unfortunately, it didn't help.

    Wednesday, June 15, 2016 3:15 PM
  • Hi VictorZaslavsky,

    To create a valid pipe name, we need to do the following steps, please check if you do all the steps of below.

    1.Specify an Alias Name.

    2.Select Named Pipes as the Protocol.

    3.Enter the Pipe Name. Alternatively, you can leave Pipe Name blank and SQL Server Configuration Manager will complete the appropriate pipe name after you specify the Protocol and Server

    4.Specify a Server. For a named instance you can provide a server name and instance name.

    In addition, please try to modify the connection string like this:

     <add name="PhoneBookConnectionString"connectionString="Data Source=\\<change it as your remote IPAddress>\pipe\MSSQL$SQLEXPRESS01\sql\query;Initial Catalog=&quot;Election Phone Book&quot;;Integrated Security=True;User Id=user_name; Password=user_password;"providerName="System.Data.SqlClient"/>

    Best regards,

    Cole Wu


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, June 17, 2016 6:44 AM
    Moderator