Click here to Skip to main content
15,886,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

I have done all the settings below mentioned

1.Try to connect sql server from your server using management studio . if you use windows authentication to connect sql server then set your application pool identity to server administrator .

2.if you use sql server authentication then check you connection string in web.config of your web application and set user id and password of sql server which allows you to log in .

3.if your database in other server(access remote database) then first of enable remote access of sql server form sql server property from sql server management studio and enable TCP/IP form sql server configuration manager .

4.after doing all these stuff and you still can't access the database then check firewall of server form where you are trying to access the database and add one rule in firewall to enable port of sql server(by default sql server use 1433 , to check port of sql server you need to check sql server configuration manager network protocol TCP/IP port) .

5.if your sql server is running on named instance then you need to write port number with sql serer name for example 117.312.21.21/nameofsqlserver,1433 .

still its not working for me. Is there any other way to get the result
Posted

Basically, when you failed to connect to your SQL Server, the issue could be:
1) Network issue,
2) SQL Server configuration issue.
3) Firewall issue,
4) Client driver issue,
5) Application configuration issue.
6) Authentication and logon issue.
Check these
Steps to troubleshoot SQL connectivity issues[^]
SQL Server 2005 Connectivity Issue Troubleshoot - Part I[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part II[^]
Troubleshoot Connectivity Issue in SQL Server 2005 - Part III[^]

EDIT
----------------
7 things to check to resolve “A network-related or instance-specific error occurred while establishing a connection to SQL Server…”[^]
 
Share this answer
 
v2
Comments
SukirtiShetty 22-Nov-13 22:34pm    
I have tried all these steps but still its not working.
thatraja 22-Nov-13 23:13pm    
We need more details instead of 'not working'
SukirtiShetty 22-Nov-13 23:25pm    
I am trying to connect database from remote server in c# windows application for authentication but it is not connecting to database..
If i try to connect database from server in my sql server by providing ip address it shows me the below error message.

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) (Microsoft SQL Server, Error: -1)
SukirtiShetty 22-Nov-13 23:26pm    
Please help me on this.
thatraja 23-Nov-13 1:35am    
Did you really try all those options? Some time, you need to restart your machine after some change-settings. Do that carefully again.

FYI, this answer helped many people in past here.
I have the same issue.

Solution for my case:


We have to whitelist the Client Sql server IP Address in the Main Sql server.

My case i am transferring data from one client SqlServer to Master Sql server machine.. that time from the issue came....

We sort it out by white listing the client machine IPAddress..
 
Share this answer
 
Hi Sukirti,

Have you tried enabling all the port in the remote server(3rd point) in sql server configuraiton manager --> Client protocols --> enable all the Ports in that?

If you have done that already ignore this.

Hope this helps you a bit

Regards,
RK
 
Share this answer
 
Comments
SukirtiShetty 22-Nov-13 3:24am    
Yes I have tried even that.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900