error: 26 - Error Locating Server/Instance Specified

Last post 05-08-2008 10:30 PM by Benson Yu - MSFT. 5 replies.

Sort Posts:

  • error: 26 - Error Locating Server/Instance Specified

    05-04-2008, 9:14 AM
    • Loading...
    • JWTech
    • Joined on 02-24-2006, 5:40 AM
    • Posts 36

    I'm have my site set up through a hosting compnay. I have checked to make sure that the server allows remote connections, which it does. I have gone through the web.config file and put a <clear/> tag in to the connection strings  section and i also put in a <remove name="DBConnection"/> tag in and i'm still getting this error.

    Here is the Config file


    <configuration>

      <appSettings />   
      <connectionStrings>
        <clear/>
        <remove name="LocalSqlServer"/>
        <remove name="DBConnection"/>
        <add name="DBConnection"
             connectionString="serverserverip;uid=uid;pwd=pwd;Trusted_Connection=no;database=dbname;"
             providerName="System.Data.SqlClient" />
      </connectionStrings>  
        <system.web>
            <!--
                Set compilation debug="true" to insert debugging
                symbols into the compiled page. Because this
                affects performance, set this value to true only
                during development.
            -->

            <compilation debug="true" />

            <!--
                The <authentication> section enables configuration
                of the security authentication mode used by
                ASP.NET to identify an incoming user.
            -->

            <authentication mode="Windows" />
            <!--
                The <customErrors> section enables configuration
                of what to do if/when an unhandled error occurs
                during the execution of a request. Specifically,
                it enables developers to configure html error pages
                to be displayed in place of a error stack trace.
            -->

          <customErrors mode="Off" ></customErrors>
          <membership>
            <providers>
              <remove name="AspNetSqlMembershipProvider"/>
              <add name="AspNetSqlMembershipProvider"
                   type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                   connectionStringName="DBConnection"
                   enablePasswordRetrieval="false"
                   enablePasswordReset="true"
                   requiresQuestionAndAnswer="true"
                   applicationName="/"
                   requiresUniqueEmail="false"
                   passwordFormat="Hashed"
                   maxInvalidPasswordAttempts="5"
                   minRequiredPasswordLength="7"
                   minRequiredNonalphanumericCharacters="1"
                   passwordAttemptWindow="10"
                   passwordStrengthRegularExpression="" />
            </providers>
          </membership>
          <profile>
            <providers>
              <remove name="AspNetSqlProfileProvider"/>
              <add name="AspNetSqlProfileProvider"
                   connectionStringName="DBConnection"
                   applicationName="/"
                   type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </providers>
          </profile>
          <roleManager>
            <providers>
              <remove name="AspNetSqlRoleProvider"/>
              <add name="AspNetSqlRoleProvider"
                   connectionStringName="DBConnection"
                   applicationName="/"
                   type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />         
            </providers>
          </roleManager>
        </system.web>
        <system.net>
          <mailSettings>
            <smtp from="email">
              <network host="email" password="pwd" userName="uid" />
            </smtp>
          </mailSettings>
        </system.net>
    </configuration>

    any information to try to solve this would be great.

     

     

     

  • Re: error: 26 - Error Locating Server/Instance Specified

    05-04-2008, 11:00 AM
    • Loading...
    • Shocker-z
    • Joined on 09-17-2007, 3:10 PM
    • Nottingham, England
    • Posts 51

    You mention instance name which means your connection string should be as follows

     

    <add name="DBConnection"
             connectionString="serverserverip\InstanceName;uid=uid;pwd=pwd;Trusted_Connection=no;database=dbname;"
             providerName="System.Data.SqlClient" />

     Regards

    Liam 

  • Re: error: 26 - Error Locating Server/Instance Specified

    05-04-2008, 1:17 PM
    • Loading...
    • JWTech
    • Joined on 02-24-2006, 5:40 AM
    • Posts 36

    How do I know what the instance would be for my db.

  • Re: error: 26 - Error Locating Server/Instance Specified

    05-04-2008, 3:11 PM
    • Loading...
    • Shocker-z
    • Joined on 09-17-2007, 3:10 PM
    • Nottingham, England
    • Posts 51

    You can check services (start > run > services.msc) look for SQL Server (INSTANCE NAME)  the default for 2005 express is "SQL Server (SQLEXPRESS)"

     

    Also you could create a datasource and click the dropdown list which should list it.

     

    Regards

    Liam 

  • Re: error: 26 - Error Locating Server/Instance Specified

    05-04-2008, 10:33 PM
    • Loading...
    • JWTech
    • Joined on 02-24-2006, 5:40 AM
    • Posts 36

    I looked through the settings for the hosting companys Sql server and under the instance section thre was noting listed. So, I don't think there is a instance specified for there server.

  • Re: error: 26 - Error Locating Server/Instance Specified

    05-08-2008, 10:30 PM
    Answer

    JWTech:
    <add name="DBConnection"
             connectionString="serverserverip;uid=uid;pwd=pwd;Trusted_Connection=no;database=dbname;"
             providerName="System.Data.SqlClient" />

    Hi JWTech,

    In my opinion, it is the incorrect connection string causes the issue. Where is the “Server” keyword in the connection string? For example, please refer to the following connection string.

      <add name=" DBConnection" connectionString=" Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False;"   providerName="System.Data.SqlClient" />

    For more sample SQL Server connection strings, please refer to the following link:

    http://www.connectionstrings.com

    Sincerely,
    Benson Yu
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (6 items)