We use this same connection string on two other servers with no problems but we are now trying to connect from another server. The error we are getting is
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)
We are using .net 2 for our web apps on all these servers. I am able to connect to a sql server 2008 database from this server. Is there some configuration I am missing to get this to work?
1) Make sure your server name is correct, e.g., no typo on the name.
2) Make sure your instance name is correct and there is actually such an instance on your target machine.
3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
4) Make sure SQL Browser service is running on the server.
5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.
Once you are done the steps, you should not see this error message anymore. You may still fail to connect your SQL server, but error message should be different and you have a different issue now. [Update: If it still fails, you may replace server\instance
with tcp:server\instance and/or np:server\instance and see if it succeeds with either TCP or NP protocol. That way, you can isolate the issue a little bit. ]
There is one corner case where you may still fail after you checked step 1)-4). It happens when a) your server is a named instance on cluster or on a multi-homed machine, and b) your client is a Vista machine with Firewall on.
royalhale
Member
7 Points
42 Posts
Can't find database by name
Apr 16, 2010 08:24 PM|LINK
We have a sql server 2005 database with a name like server/name. The connection string looks like
<add name="PPDF" connectionString="Data Source=server\name;User Id=id;Password=pwd;Initial Catalog=database"/>
We use this same connection string on two other servers with no problems but we are now trying to connect from another server. The error we are getting is
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)
We are using .net 2 for our web apps on all these servers. I am able to connect to a sql server 2008 database from this server. Is there some configuration I am missing to get this to work?
Thanks
Royal
Royal
Waqar_ali
Contributor
3325 Points
693 Posts
Re: Can't find database by name
Apr 16, 2010 09:14 PM|LINK
1) Make sure your server name is correct, e.g., no typo on the name.
2) Make sure your instance name is correct and there is actually such an instance on your target machine.
3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
4) Make sure SQL Browser service is running on the server.
5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.
Once you are done the steps, you should not see this error message anymore. You may still fail to connect your SQL server, but error message should be different and you have a different issue now. [Update: If it still fails, you may replace server\instance with tcp:server\instance and/or np:server\instance and see if it succeeds with either TCP or NP protocol. That way, you can isolate the issue a little bit. ]
There is one corner case where you may still fail after you checked step 1)-4). It happens when a) your server is a named instance on cluster or on a multi-homed machine, and b) your client is a Vista machine with Firewall on.
Software Engineer
Please mark as answer if it help you.