Exception - error 26 - Error Locating Server Instance Specified
 
Author:
Filed Under: SQL Server  |  Issues and Exceptions
Published Date: May 09, 2009
Views: 9060
 

Abstract: Here Mudassar Ahmed Khan has explained how to resolve the exception SQL Network Interfaces error: 26 - Error Locating ServerInstance Specified while connecting to SQL Server Database.

Comments:  0

 

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)



SQL Server exception message

I have seen many developers facing the above error on forums, hence I decided to explain the causes of the same.

Below is a Sample connection string

<connectionStrings>

    <add name="conString"

       connectionString="Data Source=MCN-1\SQLExpress;

                         database=Northwind;

                         Integrated Security=true" />

</connectionStrings>

 

The error simply states that it is not able to locate the SQL Server Instance in above connection string (\SQLExpress). One of the causes of this error comes in the incorrect connection string due to misspelled names of server of instances.

Mainly one should check.

1. Data Source or Server Name or IP address is Correct. For example here MCN-1

2. If any instance used check whether the instance name is correct. For example here SQLExpress

3. If any remote connections check if there is some firewall installed if yes disable it.

4. Also check if remote connections are configured in SQL Server. To configure SQL Server to allow   remote connections read here. This article also explains how to create an exception in firewall in order to allow remote connections.

5. If it’s a remote server check if you are able to connect to the server or not. Try pinging to the server. Make sure your machine is connected to the server through LAN or internet.

 

Finally also make sure that the SQL Server Browser service is running on the system. If it is stopped start it

The above helped me solve my issue. If someone else has anything other than above please feel free to share.









Related Articles



Comments

No comments have been added to this article.

Add comments

You can add your comment about this article using the form below. Make sure you provide a valid email address
else you won't be notified when the author replies to your comment

Please note that all comments are moderated and will be deleted if they are
  • Not relavant to the article
  • Spam
  • Advertising campaigns or links to other sites
  • Abusive content.
Please do not post code, scripts or snippets.

Name*: Required
Email*: Required
Comment*: Required
Security code*: CaptchaInvalid Security Code
  Submit