I get the following error whilst trying to connect from an ASP.NET web application from a particular server to an instance of SQL Server 2005 on a different server.
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)
This article lists 5 steps:
http://blogs.msdn.com/b/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx
We have eliminated each of these (there is no firewall).
Running the application on a different web server (in the same network) and it can connect to the database. Similarly, running the database on a different server, and the application can see it. It appears to be a problem between these two servers.
The problem occurred at random. It was working one minute, then not, and hasn't been working since. Nothing was installed or changed (as far as I can work out) on the server.
Any ideas?
Thanks
Have you tried connecting using an IP address rather than a qualified server name in the connection string? Sometimes the remote server can not be resolved but the IP address can be, depending on domain/network dns setup.
Related
I have a web forms application that is connecting to a SQL Server 2012 database. When I try to open the connection within the app I get this error:
System.Data.SqlClient.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: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.) ---> ...
I've checked and SQL server is configured to allow remote connections, TCP/IP is enabled, the server is up and I can connect to it via SSMS and Linqpad.
This is occurring when I run the application locally, hitting a local database. I know the connection string works, as I can use the login in SSMS to login and I have a linqpad query that is working with no problem using the same connection string. Also the error occurs when I try to open the connection (i.e. the connection is created successfully).
I'm guessing there is some access/security issues with my configuration of IIS, but I not finding it.
After a couple of frustrating days, I discovered the solution. The problem was that SQL server wasn't setup to use TCP/IP. This is configured in the Sql Server Configuration Manager, under the SQL Serer Network Configuration node, then Protocols for MSSQLSERVER. Make sure TCP/IP is enabled.
I'm having some trouble with the asp.net "register/login system" that comes ready with the AspNet MVC template.
It worked great for me up until recently that I started receiving the following error:
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)
I tried running old versions of the code that used to work and they failed as well, I don't know what could have caused it.
Thanks ahead!
Eran
Check the SQL Server service account
If you are not using a domain account as a service account (for
example if you are using NETWORK SERVICE)
you may want to switch this first before proceeding
If you are using a named SQL Server instance
make sure you are using that instance name in your connection strings in your ASweb P.NET application
Usually the format needed to specify the database server is
machinename\instancename
Check your connection string as well
Check that you have connectivity to the SQL Server
. Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
Start > Run > cmd
netstat -ano| findstr 1433
telnet myserver 1433
ping -a myserver
more info at: http://www.sqlmusings.com/2009/03/11/resolving-a-network-related-or-instance-specific-error-occurred-while-establishing-a-connection-to-sql-server/
This problem occur usually when you publish your project. This happens when there is problem in connection string and make sure you SQL server as well as SQL server browser are running.
I try to connect to remote SQL Server 2008 Express database from my ASP.NET web application but error throws:
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)
How to resolve that problem. Thanks!
Here's the first thing to check. By default Express only has the shared memory protocol enabled. You'll need to enable TCP/IP protocol for the service (SQLEXPRESS). You do this through the SQL Server Configuration Manager.
Also since Express is a named instance, you'll need to ensure that the SQL Server Browser service is started.
Make sure your connection string is correct. When you are hitting a named instance (SQLEXPRESS in this case) you need to have the data source as yourServer\sqlexpress.
And not to mention, make sure you can ping the box that houses the instance.
Check those things out and let me know if that still doesn't fix it.
i thing your connection string is not correct. Also check a named instance you try to data source as IPaddress\sqlexpress. Like 000.000.000.000\SqlExpress
I have a ASP.NET application that connects to a SQL server backend on another server. At random points throughout the day I will get a message when logging into the application that states:
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)
This may happen 2-3 times per day and will last about 30 minutes or so. The everyting will run fine for a few more hours until it happens again. The crazy thing about it is that I cannot even ping the server using its hostname while this error is occurring. I can ping it by the IP address though. Once the web application can connect again I can ping the server again by its hostname.
Even stranger is that I have another web application that is running on the same webserver and uses the same SQL server database as a backend that continues to function while the other web application is generating the error.
Each application is running on a different application pool on IIS 6 (Recyclying the affected app pool does not appear to resolve the problem). Both applications run on .NET 4 and the webserver is Windows Server 2003. The database is running on SQL Server 2008.
Any ideas what my issue could be?
Looks like a DNS issue, and it probably has nothing to do with your code. Can you use the IP address in your connection string instead?
I have a login page that works in my local development environment. When I push the site onto the web server, i am getting this error when trying to login from the asp.net login control.
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)
I cannot figure out why it does not work on the server. Do I need to add anything or change something in the web.config?
This support article may help. It may also be a firewall issue or an authentication issue on the new setup (but the error message makes that less likely).
For resolving error 26 in sql server you need to do the following steps.
At Server System
1. Under surface area configuration manager-Open up remote connections.
2. Add into firewall 1433 and 1434 port no as n exception.
3. Open port 1433 on router for WAN access.
4. Add client machine ip address as an exception to your antivirus or allow LAN settings in antivirus.
5. Now try to check if both client and server are connected to each other.
for this type "ping IP address of remote system" at run and if reply is obtained then do same for server machine.
If reply is obtained from both machines.
Open Sql server and try to connect to remote machine which allow remote connections using its ip address. U will surely get connected to server machine
See this video
Check to make sure TCP/IP is enabled on the SQL Server. For whatever reason, named pipes and TCP/IP is off by default. Also make sure you are trying to connect to the correct instance (maybe you are using ./SQLEXPRESS locally and on the server SQL is installed on the default instance). Lastly, make sure the database you are trying to connect to exists on the server.