Can someone help me with the server_name/Instance_name format of my connection string?

Discussion in 'Databases' started by LemonShark, Aug 26, 2013.

  1. Hi I’m getting this error message:
    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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
    After some research I think it has something to do with a specific named instance of the server. Can someone help me with how to format my string so that it has the server_name\instance_name or server_name/instance_name format? Or any help would be greatly appreciated. Here’s what I thought I should use according to Winhost.
    <connectionStrings>
    <add name="ApplicationServices" connectionString="Data Source=tcp: TheDatabase.com;Initial Catalog= TheNameOfTheDatabase; User ID= Username; Password=*****;Integrated Security=False" providerName="System.Data.SqlClient" />


    </connectionStrings>
     
    Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    You need to use the connection string found in the Control Panel:

    1) Log into the Winhost Control Panel at https://cp.Winhost.com
    2) Click on the Sites tab.
    3) Click on the Manage link next to the site you want to manage.
    4) Click on the MS SQL Manager button.
    5) Click on the Manage link next to the database you want to manage.

    The connection string information will appear at the bottom. Please remember to replace the ****** in the password section with your actual database password which is initially set to be the same as your site password. If you have forgotten it, use the Edit link next to Database Password to change it.

    The named instance won't work because we don't support Windows Authentication.
     
    Last edited by a moderator: Oct 14, 2015
    Michael likes this.
  3. I've used it as it was given in the control panel and got the same error message. As a newbie I thought I would try making changes to the connection string. Assuming that's the correct format of the string I can't find any where else in the web.config file that is trying to access the database and not getting the server/instance correct. I'll keep looking and reading but If you have any other ideas I would really appreciate them. Thanks.
     
  4. Elshadriel

    Elshadriel Winhost Staff

    I took a quick look at your web.config file. Try removing this at the end of your connection string:

    Code:
    ;User Instance=true
     
  5. Thanks, I've tried that as well. I'm realizing that even if I have the correct string my ISP is blocking the port that allows access to ms sql so I'm switching to MySQL.
     
  6. Elshadriel

    Elshadriel Winhost Staff

    I'm glad you were able to find and solve the problem. If your ISP is blocking port 1433, you could also try connecting on port 14330. We provide that as an alternate port in case something like this happens.
     

Share This Page