Меню

Provider sql network interfaces error 26 ошибка при обнаружении указанного сервера или экземпляра

Добрый день!

Прошу помощи в решении следующей проблемы.

Есть корпоративная сеть из нескольких машин с разрядностью как 32, так и 64. Авторизация происходит по доменным учетным записям.

Установила на 64-разрядную машину 2 пользовательских инстанса SQL Server 2008 R2: один со смешанным режимом авторизации (пользователь sa), другой с проверкой подлинности Windows.

1. Sql Browser запущен.

2. TCP IP включен.

3. Брандмауэр windows Отключен.

4. В Sql Server Management Studio стоит галочка: allow remote connections.

Локально все подключается нормально. Второй 64-разрядный комп в сети также спокойно подключается к инстансам.
32-разрядные компы же выдают следующую
ошибку
:

При установлении соединения с SQL Server произошла ошибка, связанная с сетью или с определенным экземпляром. Сервер не найден или недоступен. Убедитесь, что имя экземпляра указано правильно и что на SQL Server разрешены удаленные соединения. (provider:
SQL Network Interfaces, error: 26 — Ошибка при обнаружении указанного сервера или экземпляра)

Подскажите, в чем может быть проблема?

  • Remove From My Forums

 locked

provider: SQL Network Interfaces, error: 26 — Error Locating Server/Instance Specified

  • Question

  • I used profile for shopping cart 

     Collapse

    <system.web>
    <anonymousIdentification enabled="true"/>
    <customErrors mode="Off"></customErrors>
    <profile enabled="true">
    <properties>
    <add name="SCart" serializeAs="Binary" type="Tandis.Cart" allowAnonymous="true"/>
    </properties>
    </profile>
    </system.web>

    Server Error in ‘/’ Application.


    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)

    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.Data.SqlClient.SqlException: 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)

    Source Error:

    Line 19:   public virtual Tandis.Cart SCart {
    Line 20:     get {
    Line 21:       return ((Tandis.Cart)(this.GetPropertyValue("SCart")));
    Line 22:     }
    Line 23:     set {

    Source File: c:windowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesroot2faf057937b1b4f4App_Code.1mhfv5r1.3.cs   
    Line: 
    21 

    Stack Trace:

    [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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
      System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849719
      System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
      System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4863021
      System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90
      System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +376
      System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
      System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
      System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4864151
      System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
      System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
      System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
      System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
      System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
      System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
      System.Data.SqlClient.SqlConnection.Open() +122
      System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87
      System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221
      System.Web.Profile.SqlProfileProvider.GetPropertyValuesFromDatabase(String userName, SettingsPropertyValueCollection svc) +772
      System.Web.Profile.SqlProfileProvider.GetPropertyValues(SettingsContext sc, SettingsPropertyCollection properties) +433
      System.Configuration.SettingsBase.GetPropertiesFromProvider(SettingsProvider provider) +258
      System.Configuration.SettingsBase.GetPropertyValueByName(String propertyName) +132
      System.Configuration.SettingsBase.get_Item(String propertyName) +102
      System.Web.Profile.ProfileBase.GetInternal(String propertyName) +36
      System.Web.Profile.ProfileBase.get_Item(String propertyName) +68
      System.Web.Profile.ProfileBase.GetPropertyValue(String propertyName) +7
      ProfileCommon.get_SCart() in c:windowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesroot2faf057937b1b4f4App_Code.1mhfv5r1.3.cs:21
      Showbook.Button2_click(Object sender, EventArgs e) in c:inetpubvhoststandisbooks.irhttpdocsShowbook.aspx.cs:22
      System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
      System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
      System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
      System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
      System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
      System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4209

    it works locally on IIS but on the host it gives this error!
    what should I do ? (my host is plesk 9.5 )

Answers

  • Hi Nima,

    Thank you for your post.

    The reasons for throwing this issue could be wrong server name, disabled remote connection

    and firewall blocking.

    Could you please follow the steps below to solve this issue?

    ·         Check the server on which SQL Server is running can be accessible. You can use ping command to test that. For instance, ping <computer_name> or ping <IP_address>.
    The ping command may be block by the firewall, make sure ICMP is enabled in the firewall. More info, check:

    http://technet.microsoft.com/en-us/library/cc739791%28v=ws.10%29.aspx#BKMK_4.

    ·         Choose appropriate protocol

    ·         Configure Windows firewall accordingly based on what protocol you have chosen to use. For detailed information about how to configure Windows Firewall to allow SQL Server,
    please check http://msdn.microsoft.com/en-us/library/cc646023.aspx.

    ·         Enable SQL Server Browser Services

    You need to enable SQL Server Browser Services if the following are both true:

    1.       SQL Server is not listening on default 1433 port or not use default pipe name
    \.pipesqlquery;

    2.       The corresponding TCP port or pipe name is not specified in the connection string (such as Srv1SQL2008, 1500).

    If you have enabled SQL Server Browser Services, you still need to open UDP 1434 port which is used by Browser Services in the Windows firewall.


    Best Regards,
    Peja Tao

    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.

    • Proposed as answer by

      Friday, March 18, 2011 6:36 AM

    • Marked as answer by
      Alex Feng (SQL)
      Friday, March 25, 2011 4:19 AM

5 / 5 / 3

Регистрация: 05.03.2013

Сообщений: 220

1

19.07.2014, 21:18. Показов 88453. Ответов 8


Помогите пожалуста исправить
неполучается соеденится с SQL Server.

При установлении соединения с SQL Server произошла ошибка, связанная с сетью или
с определенным экземпляром. Сервер не найден или недоступен. Убедитесь, что имя
экземпляра указано правильно и что на SQL Server разрешены удаленные соединения
. (provider: SQL Network Interfaces, error: 26 — Ошибка при обнаружении указанно
го сервера или экземпляра)

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



1239 / 1049 / 293

Регистрация: 07.03.2012

Сообщений: 3,245

22.07.2014, 10:07

3

типичная ошибка при неверной строке соединения. Покажите, как соединяетесь



1



mixon-21

5 / 5 / 3

Регистрация: 05.03.2013

Сообщений: 220

22.07.2014, 17:14

 [ТС]

4

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
 
namespace SQL_2
    {
    class Program
        {
        static void Main( string[] args )
            {
            string urce=@"Data Source=.MSSQL10_50.MSSQLSERVERMSSQLDATA;
Initial Catalog=EvelDb; 
Integrated Security=True";
            SqlConnection conn = new SqlConnection ( urce );
            try
                {
                conn.Open ();
                Console.WriteLine ( conn.State );
                }
            catch( Exception ex )
                {
                Console.WriteLine ( ex.Message );
                }
            finally
                {
                conn.Close();
                Console.WriteLine ( conn.State );
                }
            Console.ReadLine ();
            }
        }
    }



0



1239 / 1049 / 293

Регистрация: 07.03.2012

Сообщений: 3,245

22.07.2014, 17:36

5

mixon-21,
management studio откройте, соединитесь с сервером, слева в верхнем углу будет прописано то, что должно быть в Data Source

Примерно так должно быть: CompNamesqlexpress



0



5 / 5 / 3

Регистрация: 05.03.2013

Сообщений: 220

22.07.2014, 18:32

 [ТС]

6

management studio откройте, соединитесь с сервером, слева в верхнем углу будет прописано то, что должно быть в Data Source

Примерно так должно быть: CompNamesqlexpress

МИША-ПК(SQL Server10/50.1600-Миша-ПКМиша)

Оно???



0



1239 / 1049 / 293

Регистрация: 07.03.2012

Сообщений: 3,245

22.07.2014, 18:53

7

Цитата
Сообщение от mixon-21
Посмотреть сообщение

МИША-ПК(SQL Server10/50.1600-Миша-ПКМиша)

не думаю что такое сочетание скобок и разных видов слешей ему понравится

Добавлено через 50 секунд
попробуйте просто МИША-ПК



0



mixon-21

5 / 5 / 3

Регистрация: 05.03.2013

Сообщений: 220

22.07.2014, 23:26

 [ТС]

8

Добавлено через 4 часа 6 минут
Подскажите как данные базы данных вывести на консоль???

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace ConsoleApplication1
    {
    class Program
        {
        static void Main( string[] args )
            {
            using( SQLiteConnection conn = new SQLiteConnection ( "Data Source=foods.db" ) )
                {
                try
                    {
                    conn.Open ();
                    string strSql = "Select * From foods";
                    SQLiteCommand comand = new SQLiteCommand ( strSql, conn );
                    SQLiteDataReader reader = comand.ExecuteReader ();
 
                    while( reader.Read () )
                        {
                        Console.WriteLine ( reader.GetInt32 ( 0 ) + ", " + reader.GetString ( 1 ) );
                        }
                    // always call Close when done reading.
                    reader.Close ();
                    //
                    //SQLiteCommand testComand = new SQLiteCommand ();
                    //testComand.Connection = conn;
                    //testComand.CommandText = strSql;
                    }
                catch( Exception e )
                    {
                    Console.WriteLine ( e.Message );
                    }
                finally
                    {
                    conn.Close ();
                    Console.WriteLine ( conn.State );
                    }
                }
            Console.ReadLine ();
            }
        
        }
    }

выводит ошибку. как правильно???

Заданное приведение является недопустимым.
Closed



1



Alex_student

18 / 18 / 8

Регистрация: 10.02.2013

Сообщений: 250

23.07.2014, 10:43

9

К сожалению нет времени посидеть над вашим кодом, но посмотрите код из моего старого проекта, насколько помню работал без вопросов:

C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public ArrayList GetAllDebitors()
        {
            ArrayList alldebitors = new ArrayList();
            using (SqlConnection con = new SqlConnection(connectionString))
            {
                SqlCommand com = new SqlCommand("SELECT * FROM Debitors Order By Name", con);
 
                try
                {
                    con.Open();
                    SqlDataReader dr = com.ExecuteReader();
                    if (dr.HasRows)
                        foreach (DbDataRecord result in dr)
                            alldebitors.Add(result);
                }
                catch
                {
 
                }
            }
            return alldebitors;
        }



1



User1210869336 posted

I created a site where users can log in.  When I tested the login system locally everything worked.  I uploaded all the files, including the MDF database, to the webhost.  The login doesn’t work now.  I get the error 26

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)
  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.Data.SqlClient.SqlException: 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)

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.
[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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5064458
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +270
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5078107
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +95
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +206
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +827
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129
   System.Web.UI.WebControls.Login.AttemptLogin() +127
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

My web.config

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
      <authentication mode="Forms">
          <forms loginUrl="~/login.aspx" defaultUrl="~/index.aspx" />
      </authentication>
    <roleManager enabled="true" />
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
      <!-- maintains scroll position on postback -->
      <pages maintainScrollPositionOnPostBack="true" />
      <!-- multiple sitemaps -->
      <siteMap>
          <providers>
              <add siteMapFile="~/Web.sitemap" name="SiteMap1" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
          </providers>
      </siteMap>
  </system.web>
</configuration>

PLEASE help me to get it working on the site.

User1210869336 posted

I created a site where users can log in.  When I tested the login system locally everything worked.  I uploaded all the files, including the MDF database, to the webhost.  The login doesn’t work now.  I get the error 26

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)
  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.Data.SqlClient.SqlException: 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)

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.
[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: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5064458
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
   System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +270
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +5078107
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +524
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +479
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +108
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
   System.Data.SqlClient.SqlConnection.Open() +125
   System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +95
   System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +206
   System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +827
   System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
   System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +106
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +129
   System.Web.UI.WebControls.Login.AttemptLogin() +127
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +125
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +167
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

My web.config

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|Database.mdf;Integrated Security=True;User Instance=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
      <authentication mode="Forms">
          <forms loginUrl="~/login.aspx" defaultUrl="~/index.aspx" />
      </authentication>
    <roleManager enabled="true" />
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
      <!-- maintains scroll position on postback -->
      <pages maintainScrollPositionOnPostBack="true" />
      <!-- multiple sitemaps -->
      <siteMap>
          <providers>
              <add siteMapFile="~/Web.sitemap" name="SiteMap1" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
          </providers>
      </siteMap>
  </system.web>
</configuration>

PLEASE help me to get it working on the site.

Проблема

При попытке добавления рабочей группы в Vault с помощью консоли Autodesk Data Management Server (ADMS) или установки с помощью удаленного сервера SQL появляется следующее сообщение об ошибке:

———————
Консоль Autodesk Data Management Server
———————
При установке подключения к SQL Server произошла ошибка, связанная с сетью или экземпляром. Сервер не найден или недоступен. Убедитесь, что имя экземпляра указано правильно и SQL Server разрешает удаленные подключения (поставщик: сетевые интерфейсы SQL, ошибка: 26 — ошибка при поиске сервера/указанного экземпляра)
———————
ОК
———————

В журнале консоли ADMS Console появляется следующая запись:

Ошибка: Соединение с базой данных разорвано. Повторный запуск операции.
Исключение: ошибка, связанная с сетью или экземпляром, произошла при установке подключения к SQL Server. Сервер не найден или недоступен. Убедитесь, что имя экземпляра указано правильно и SQL Server разрешает удаленные подключения (поставщик: сетевые интерфейсы SQL, ошибка: 26 — ошибка при поиске сервера/указанного экземпляра)
Трассировка стека: в Connectivity.Core.Database.TransactionContext.OnSqlException(SqlException e)
в Connectivity.Core.Database.TransactionContext..ctor(база данных TransactionDatabase, пользователь базы данных DatabaseUser, логическая транзакция)
в Connectivity.Core.Database.TransactionBase.SetupTransactionContext(TransactionReqs, база данных TransactionDatabase, Nullable`1 dUsus)
в Connectivity.Core.BusinessLogic.WorkgroupBL.Database.CleanupRemoteSubscription(Workgroup publisher, String publationnameation, Staseasea)
в Connectivity.Core.BusinessLogic.WorkgroupBL.Database.Subscribe(рабочая группа, целевая рабочая группа, имя базы данных строки, тип базы данных KnowledgeDatababaseaseTypeaseType, стро, строaseUsUser, St, St, Ster ag)
в Connectivity.Core.BusinessLogic.WorkgroupBL.Create(String sqlServer, String sauser, String saPassword, String agent Agator Passassworworwory Lworal Ler)
в System.Runtime.Remoting.Messaging.Message.Dispatch(Объект цель)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Причины

  • Соединения между сервером источника и сервером подписчика разорваны. 
  • Это произошло из-за проблемы DNS (Domain Name System) между двумя доверенными доменами. Корневая причина проблемы должна быть изучена администратором DNS доменов.
  • Экземпляр SQL Server не запущен.

Решение

Убедитесь, что соединения между двумя узлами установлены. Простую проверку можно выполнить, выполнив следующие действия. Если соединение установлено некорректно, как указано в одном из следующих тестов, проблема подключения должна быть решена сетевым инженером или администратором базы данных:

  • Убедитесь, что SQL Server в источнике может подключиться к SQL Server в подписчике с помощью SSMS (SQL Server Management Studio), подключившись к экземпляру AUTODESKVAULT. 
  • Убедитесь, что SQL Server в подписчике может подключаться к SQL Server в источнике с помощью SSMS (SQL Server Management Studio), подключившись к экземпляру AUTODESKVAULT.

Если проблемы вызваны проблемами с DNS (Domain Name System) между двумя сайтами, одним из возможных способов разрешения имен будет использование файлов узлов на каждом сервере. Выполните указанные ниже действия. 

  1. После установления соединения между двумя сайтами убедитесь, что и издателю, и всем подписчикам назначен статический IP-адрес.
  2. На сервере издателя откройте файл hosts в Блокноте Windows. Файл находится в папке C:WindowsSystem32driversetc.
  3. Вставьте имя хоста компьютера (краткое имя) и IP-адрес подписчика.
  4. На сервере подписчика откройте файл hosts в Блокноте Windows. Файл находится в папке C:WindowsSystem32driversetc.
  5. Вставьте имя узла компьютера издателя (краткое имя) и IP-адрес.
  6. Сохраните файл.

Убедитесь, что экземпляр SQL Server, используемый Vault, запущен, если он не запущен.

  1. Войдите на сервер, на котором размещен экземпляр SQL Server, используемый Vault.
  2. Откройте консоль служб.
  3. Проверьте состояние службы SQL Server. По умолчанию это будет SQL Server (AUTODESKVAULT), но имя будет меняться, если имя экземпляра отличается от AUTODESKVAULT.
  4. Если статус не указан как выполняющийся, щелкните службу правой кнопкой мыши и выберите «Запустить».

Программы

Vault Professional

Methods to Resolve SQL Server Error 26

Users often see “SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified” error message while connecting to SQL Server.

SQL Server Error 26

SQL Server Error 26 occurs when users trying to connect to a SQL Server named instance. The reason of the SQL Server Error 26 is the client stack could not receive SSRP response UPD packet from SQL Browser.

Tip: Fix SQL Server Management Studio Error 40

You have to create an incoming rule that allows traffic from all promising IP addresses that are configured for the failover cluster instance and from all possible IP addresses of the remote server. For this you have to follow the below steps

    • Open Adminstrative Tools, from Control Panel
    • In Adminstrative Tools, click on Windows Firewall with Advanced Security
    • Under Windows Firewall with Advanced Security on Local Computer column, click on the Inbound Rule and then select New Rule from the right pane

Windows Firewall with Advanced Security

    • From New Inbound Rule Wizard window, select Custom and then click on the Next button

Select Custom

    • Under Does this rule apply to all programs or a specific program? select All programs then click on Next button

Select All Program

    • Form Protocol type list, select Any and then click on Next button

Select Protocol Type

    • Under Which remote OP addresses does this rule apply to? select These IP addresses and then click on Add button

Select These IP Addresses

    • In IP Address dialog box, under This IP address or subnet type the IP address and then click on Ok button

IP Address

    • Under What action should be taken when a connection matches the specified conditions? select Allow the connection and then click on Next button

Allow the connection

  • Click on the Next button to complete the New Outbound Rule Wizard steps

Other Possible Causes of SQL Server Error 26 with Solution

SQL Server does not allow remote connections

  • To resolve the SQL Server Error 26 open SQL Server Management Studio, Right click on the database and select properties
  • On Security page, select SQL Server and Windows Authentication mode and click on Ok button
  • Restart SQL Server

If you are still facing the SQL Server Error 26, then there could be a same name conflict between two systems. Check whether the computer name, system name is same if yes, then try to system using its IP address.

SQL Server Error 26 and SQL Server Error 40 appear when you try to connect to SQL Server. We will troubleshoot and try to fix them in the same article as both are related to connection issue. We recommend to use the below solutions for the both errors and to try to localize the problem.

The error Messages:

(provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

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)

“ Named Pipes Provider Error: 40 – Could not open a connection to SQL Server“.

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)

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 the SQL Server is configured to allow remote connections. (provided: Named Pipes Provider, error: 40- Could not open a connection to the SQL Server) (Microsoft SQL Server, Error: 2).

sql server error 26

sql server error 26

SQL Server Error 26 and SQL Server Error 40

What is SQL Server Error 26?

You will get this error message while trying to connect to a SQL Server named instance and not when you use default instance. The client stack could not receive SSRP response UDP packet from SQL Browser.

How to fix Error 26 on SQL Server?

  1. Recheck the server name for any error and fix it
  2. Check the instance name for any error
  3. Check if SQL Server browser is running
  4. Control if this instance exist on server
  5. Ping the server and check if DNS can be resolved correctly

What is SQL Server Error 40?

This error appears mostly when SQL Server does not allow remote connections, Firewall Settings or TCP/IP is not enabled. We will explain below all those in order to troubleshoot easy.

Read also other SQL Server Helping Posts:

  1. How to fix SQL Server Error 229
  2. Fix SQL Server Error 233
  3. SQL Server Error 17002

How to fix error 40 on SQL Server?

  1. Check SQL Server is running
  2. Make sure that Allow Remote Connections is enabled on sql server properties
  3. Check if TCP/IP is enabled
  4. Configure to allow SQL Server in Firewall Settings
  5. Check for working fine SQL Server Browser
  6. Make sure that you can ping the SQL Server

Below we will explain the above steps in long way for better understanding and easy fix of SQL error 26 and sql error 40.

1. Check if SQL Services are running

Hint! If you are running SQL Server by using an instance name and you are not using a specific TCP/IP port number in your connection string, you must enable the SQL Server Browser service to allow for remote connections.

How to check if SQL Server Service is running?

  • Go to SQL Server Configuration Manager > SQL Server Services
  • Find the service SQL Server (MSSQLSERVER) if default or the name of your instance
  • Check if is running – should be running state with a green indication

Using Windows Command Prompt

sc query mssqlserver

For named instance name use below by by replacing instancename with the actual SQL Server instance name.

sc query mssql$instancename

How to check if SQL Server Browser is running?

  • Navigate to SQL Server Configuration Manager > SQL Server Services
  • Find the SQL Server Browser Service
  • Check if it is configured to start automatically and is started – should be with a green indication

Using Windows Command Prompt

sc query sqlbrowser

Check if SQL Server Service

Check if SQL Server Service

2. Try to Flush DNS

How to flush DNS?

  1. Click Start Button
  2. Type CMD and press enter
  3. Type this into the black window that appears: ipconfig /flushdns and press enter.

Fluish DNS

Fluish DNS

3. Make sure that allow Remote Connection is enabled

Check if remote connections is allowed for applications/client. This option need to be allowed to establish connections and perform operations on the server. Often this is the reason of SQL Server Error 26 and SQL Server Error 40.

How to check if the remote connection is enabled?

  1. Open ‘SQL Server Management Studio’
  2. Right click on database name and select ‘Properties’
  3. In ‘Properties’ window, select ‘Security’, enable `SQL Server and Windows Authentication mode` and click `OK`.
  4. Now restart the SQL server.

Allow Remote Connections

Allow Remote Connections

4. Check Firewall

Check the firewall status for any troubles:

  1. Open ‘Control Panel’ and after that ‘Windows Firewall’.
  2. Select ‘Change Settings’ In ‘Windows Firewall’,
  3. Add an exception for port ‘1434’ and name it ‘SQL Server’
  4. Enable by clicking on the checkbox

5. Connection String

This solution is on cases when you are using connection string and are you writing it wrongly. For example connection string used by .NET framework:

Server=serverAddress;Database=dbName;User Id=username;

Password=password;

  1. Check for each parameter passed in the connection string for any typographical errors.
  2. Control the validity of the username/password.
  3. Confirm if the given database exists.

6. TCPIP Protocol

This solutions can work when you have mix of default and named instance or named instances only.

How to Enable TCP/IP port?

  1. Open SQL Server Configuration Manager
  2. Click on SQL Server Network Configuration and click on Protocols for Name
  3. Right-click on TCP/IP
  4. Click Enable
  5. Restart your SQL Server instance

Enable TCP-Ip port

Enable TCP-Ip port

If you want to use a static port for your instance (instead of dynamic that changes after every restart) you can change it here.

  1. Open Properties for TCP/IP protocol
  2. Go to IP Addresses tab
  3. Scroll down to IPAll section
  4. Remove 0 value from TCP Dynamic Ports
  5. Specify your port in TCP Port

You can use this port to connect to your instance by providing <servername>,<port> or <IP>,<port> as Server Name (yes, there is a comma, not a colon).

TCP-Ip static port

TCP-Ip static port

Conclusion:

We have explained some solutions to fix SQL Server Error 26 and SQL Server Error 40 and hope that you find the fix on those solutions. The both errors are included on the same article because they have almost the same troubleshoot. If you have any other solution worked for you comment below and we will try to include it on our article.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Project zomboid ошибка что делать
  • Prototype 2 ошибка сохранения