ASP.NET sites gave SQL Error: 26 – Error Locating Server

Asked By 40 points N/A Posted on -
qa-featured

Hi experts,

I get the following error message when I am trying to deal with ASP.NET or ASP sites.

I need to solve it. I need your help. Please.

Thanks.

OnASP.NET sites I get this “Server Error – Error: 26 – Error Locating Server/Instance Specified”

Server Error
Server Error in '/YourApps' 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)

Error: Server Error – Error: 26 – Error Locating Server/Instance Specified

SHARE
Best Answer by Carl Jack
Best Answer
Best Answer
Answered By 10 points N/A #139761

ASP.NET sites gave SQL Error: 26 – Error Locating Server

qa-featured

Hallo Sharon,

You should check your server and see if it is accessible and also make sure that the Remote Access from the SQL server has been turned on.

Also check the following:

  • You should ensure that the server name you are using is correct; make sure there are no misspellings.
  • Ensure that the instance name you are using is correct, and make sure that you actually have an instance on the target machine.
  • Check your machine and see if the firewall is enabled. If so, you will need to put sqlbrowser.exe and/or UDP port 1434 into the exception.
  • You need to ensure that the server machine can be reached, that is, its DNS can be resolved without a problem.

Hope this helps.

Regards,

Carl

Answered By 0 points N/A #139762

ASP.NET sites gave SQL Error: 26 – Error Locating Server

qa-featured

Ensure that you have configured your connection string well in web config file in your project so it must look like this:

Connection Strings

Where name means the name of your connection string and connection string hold your connection string details like data source that holds the location of your database and initial catalog that holds your database name and integrated security that mean you are using windows or SQL authentication.

If you are using SQL authentication you will need to provide a username and password inside connection string data and provider name that holds your database dll library name

Regards,

Answered By 5 points N/A #139763

ASP.NET sites gave SQL Error: 26 – Error Locating Server

qa-featured

Error simply means that your application is trying to access the SQL Server database and it’s not accessible.

If your database system tries in your local system below options.

Check the services on your computer system and make sure that the MSSQL instance is started.

Computer Management

If you have any passwords assigned to the SQL Server account make sure to mention the password on your application connection string.

<add name="PinCBusMgtDocs.Properties.Settings.PINCConnectionString"

connectionString="Data Source=WWPPINCS;Initial Catalog=PinCBusMgtDocs;User ID=sa;Password=123"

providerName="System.Data.SqlClient" />

Make sure your server name and the database name is correctly mentioned in the application connection string.

Answered By 20 points N/A #139764

ASP.NET sites gave SQL Error: 26 – Error Locating Server

qa-featured

Hi Sharon,

First of all, be sure whether your server is accessible or not and then be sure to turn on Remote Access from the SQL server and then you should check the following thing:
 
# Be sure of using the server name correctly and be aware of misspellings.
# Be sure of using the instance name correctly and also be sure of the fact that the target machine has an instance.
# Whether firewall is enabled on your machine, should be checked. And put sqlbrowser.exe and/or UDP port 1434 into the exception.
# If the server machine is reached, should be ensured, which means that its DNS is solvable without hazard.
 
Hope that this message will help you.

Related Questions