1. Home
  2. Cloud & Dedicated Servers
  3. Scripts and Programming
  4. ASP.NET
  5. Why am I getting the error “provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified?”

Why am I getting the error “provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified?”

ERROR MESSAGE
 

An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

RESOLUTION
 

This error is generally caused because your ASP.net application is trying to access the SQL Express database server and assumes it’s located on the same server as the website. Applied Innovations does not run SQL Express on our shared hosting servers and you will need to update your SQL database connection string in your web.config file. This string looks something like this

<add name=”classifiedsConnection” connectionString=”Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|classifiedsdb.mdf;Integrated Security=True;User Instance=True” providerName=”System.Data.SqlClient” />

You’ll want to modify this to look something like the following:

<add name=”classifiedsConnection” connectionString=”Data Source=[database server];Initial Catalog=[database name];User ID=[database username];Password=[database password]” />

Replacing the sections in brackets with your information. This error may also come from using the ASP.net membership provider and having the connectionString setting still set to LocalSqlServer, you’ll want to update that string as well if that’s the case.

Content retrieved from: https://support.appliedi.net/kb/a372/why-am-i-getting-error-provider-sql-network-interfaces-error-26-error-locating-server.aspx.

Updated on November 11, 2019

Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!
CONTACT SUPPORT