Не могу подключиться к sql серверу ошибка 26

This issue also confused me a few days, after the IT guy changed some security settings on the SQL Server.

I have an EntityFramework for the Web application and for a desktop application.

After I changed some settings on the SQL Server, the Web application comeback to work, but the desktop still facing issue. But I used the same connection string for both applications, it make no sense one is working but the other doesn’t.

Then I searched a lot until I found someone saying here it is needed to add port number 1433 after the $ServerName$DatabaseInstanceName,1433.

After I added it, the exception became:

System.Data.SqlClient.SqlException: Login failed for user
‘domainname-PC$’

Then I found this link. It says to add Trusted_Connection=False;.

The whole connection string should be like:

data source=XXXXXSQLSERVER,1433;initial catalog=XXXDB;user id=UserID;password=PWD;Trusted_Connection=False;MultipleActiveResultSets=True;

Hope this answer will help the ones out off Generic exception:

Error: 26-Error Locating Server/Instance Specified

Methods to Resolve SQL Server Error 26

SQL network interfaces error 26

Users often see “SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified” error message while connecting to SQL Server. This error 26 SQL server is quite common nowadays as a lot of users are complaining about it.

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. Now, there a few ways to solve SQL network interfaces error 26 in a smart way. Stay tuned to know the best way.

Table of Content

  1. Quick Steps Guide
  2. Windows Firewall Method
  3. Other Causes of Error 26
  4. Automated Solution
  5. FAQs

Tip: Fix SQL Server Management Studio Error 40

SQL Error 26 Quick Solution in 5 Steps

  1. Downlaod & Launch tool in your PC
  2. Click on Open to Add database files
  3. Select Quick or Advance Scan mode
  4. Select Settings & Destination Location
  5. Click on Export button to get your results

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, just follow the below steps. We’re sure that this way users can easily get rid of this SQL network interfaces error 26 for sure.

    • Open Adminstrative Tools, from Control Panel to begin solving error 26 SQL server
    • 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 to fix error 26 SQL server

    • 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

click next to SQL network interfaces error 26

  • 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 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. In addition this error 26 occurs with several issues that are mentioned below:

  • SQL network interfaces, error: 26 – error locating server/instance specified
  • provider: SQL network interfaces, error: 26 – error locating server/instance specified
  • a network related or instance specific error in SQL server error 26

Experts’ Recommended Solution to Counter Errors Causes Due to Corruption

Now when there is some sort of data corruption issues present in the server, the SQL database might react differently than what it should usually do. Therefore, experts often suggest users to get the automated repair & recovery tool.

Downlaod the tool & then follow easy steps to repair damaged data & solve SQL network interfaces error 26 with ease. In addition, if you want to know how to make SQL server faster then this tool can remove corruption as well. Ultimately resulting in a faster server.

Download Now Purchase Now

Step-1. Launch the Tool in your system & then Click the Open button.

select open button

Step-2. Select the Quick or Advanced Scan Mode as per your need.

Select mode

Step-3. Set the SQL Server database details to continue further.

Set Server

Step-4. Finally, Click on the Export button to finish the task.

export to fix sql server error 26

Frequently Asked Questions

Q-1. What is connection error 26 in SQL Express?

A: It is crucial for users to ensure that the name of their server is correct & no typo on the name is present. Always make sure that your SQL browser service is running on the server in case you are trying to connect SQL instance on another server. Your machine should be reachable.

Q-2. How do I fix error code 26?

A: The device drivers of your system are closely connected to the error 26. Removing all external devices can be a solution too here.

Q-3. What is SQL Server error 26 client unable to establish connection because an error was encountered during handshakes before login?

A: The most common reason for this is when a client connects to a unsupported version of SQL Server. Here the the error occurs because the server is too busy to accept the new connections. In some cases, resource limitation is also an issue where maximum allowed connected are pre defined.

Q-4. How do I fix SQL query error?

A: There are 4 steps to fix SQL query error as mentioned below:

  1. Navigate to the failing line in SQL query.
  2. Check failing SQL syntax in SQL query.
  3. Check query logic in joins, subqueries, or CTEs.
  4. Go to troubleshooting error messages to finish.

Q-5. How to restart SQL Server?

A: Go to SQL Server Configuration Manager >> Select SQL Server Services, Right Click a named instance or SQL Server> Select from Start, Stop, Pause, Resume & Restart options.

Q-6. How do I allow remote access to SQL Server database?

A: 5 Steps to allow remote access to SQL Server database:

  1. Start SSMS (SQL Server Management Studio)
  2. Go to Object Explorer & Right Click on Server
  3. Select Properties & then Click Connections
  4. Enable Allow Remote Connections to this Server
  5. Click on Ok to save & Finish the task.

Добрый день!

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

Есть корпоративная сеть из нескольких машин с разрядностью как 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 — Ошибка при обнаружении указанного сервера или экземпляра)

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

When I experienced this error in Visual Studio,

“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)”

…it was during the execution of the following C# code, which was attempting to obtain my SQL Server data to display it in a grid. The break occurred exactly on the line that says connect.Open():

        using (var connect = Connections.mySqlConnection)
        {
            const string query = "SELECT Name, Birthdate, Narrative FROM Friends";
            using (var command = new SqlCommand(query, connect))
            {
                connect.Open();
                using (var dr = command.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        // blah
                    }
                }
            }
        }

It was inexplicable because the SQL query was very simple, I had the right connection string, and the database server was available. I decided to run the actual SQL query manually myself in SQL Management Studio and it ran just fine and yielded several records. But one thing stood out in the query results: there was some improperly encoded HTML text inside a varchar(max) type field within the Friends table (specifically, some encoded comment symbols of the sort <!-- lodged within the «Narrative» column’s data). The suspect data row looked like this:

Name    Birthdate    Narrative
====    =========    ============== 
Fred    21-Oct-79    &lt;!--HTML Comment -->Once upon a time...

Notice the encoded HTML symbol «&lt;«, which stood for a «<» character. Somehow that made its way into the database and my C# code could not pick it up! It failed everytime right at the connect.Open() line! After I manually edited that one row of data in the database table Friends and put in the decoded «<» character instead, everything worked! Here’s what that row should have looked like:

Name    Birthdate    Narrative
====    =========    ============== 
Fred    21-Oct-79    <!--HTML Comment -->Once upon a time...

I edited the one bad row I had by using this simple UPDATE statement below. But if you had several offending rows of encoded HTML, you might need a more elaborate UPDATE statement that uses the REPLACE function:

UPDATE Friends SET Narrative = '<!--HTML Comment -->Once upon a time...' WHERE Narrative LIKE '&lt%'

So, the moral of the story is (at least in my case), sanitize your HTML content before storing it in the database and you won’t get this cryptic SQL Server error in the first place! (Uh, properly sanitizing/decoding your HTML content is the subject of another discussion worthy of a separate StackOverflow search if you need more information!)

  • 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

Понравилась статья? Поделить с друзьями:
  • Не могу подключиться к itunes неизвестная ошибка 0xe800000a
  • Не могу подключиться к ea серверам код ошибки 721
  • Не могу подключить яндекс плюс ошибка при оплате картой
  • Не могу подключить телефон к компьютеру ошибка 43
  • Не могу подключить принтер к компьютеру ошибка