SQL Server - network related error - Asked By sangeetha vijayanandh on 13-Nov-11 03:28 AM

Hi,

Thanks in advance.
When I am trying to debug my website in my local server, the following error shows
"A network related or instance specific error has occured. verify that the server name is correct and server is accessible or not."

My connection string is

add


name="GMConnectionString1" connectionString="server=.;Database=gm;Trusted connection=yes;" providerName="System.Data.SqlClient"/>

please help me out.


Suchit shah replied to sangeetha vijayanandh on 13-Nov-11 03:37 AM
Here this error coming up because of you have not defined connection string properly

add


name="GMConnectionString1" connectionString="server=.;Database=gm;Trusted connection=yes;" providerName="System.Data.SqlClient"/>


In this Server = . here you have to defined proper sql server instance name then after database which is fine which you have been defined then after username and password also required to difined. username and password are which you are using to connect that sql server instance

This error is occurring when the server name is incorrect or server is not accessible etc. To solve the error follow the below steps
.In connection string varify that the server name is correct.
Go to sql server connection wizard and try to connect with servername
 Make sure the server is allowing remote connection
 Make sure the server is accessible to you by using ping command in CMD

So give correct SQL Server instance name and give username and password for that instance to connect

Suchit shah replied to sangeetha vijayanandh on 13-Nov-11 03:40 AM

GO START -> ALL PROGRAMS -> SQL SERVER 2008/2005/2008 R2
->CONFIGURATION TOOLS->
->SELECT SQL SERVER CONFIGURATION MANAGER
->SELECT SQL SERVER NETWORK CONFIGURATION
->SELECT PROTOCOLS FOR MSSQLSERVER(YOUR INSTANT NAME)
->IN RIGHT TASK PANEL
->MAKE SURE MENTION BELOW:

DISABLE SHARED MEMORY AND VIA
ENABLE NAMED PIPE AND TCP/IP

—-MAKE SAME THING IN
->SQL NATIVE CLIENT 10.0(SERVER VERSION) CONFIGURATION – CLIENT PROTOCOLS

RESTART SQL SERVER(MSSQLSERVER [YOUR INSTANT NAME]) SERVICE

Kirtan Patel replied to sangeetha vijayanandh on 13-Nov-11 03:54 AM
This error is occurring when the server name is incorrect or server is not accessible etc. To solve the error follow the below

Step 1. In connection string varify that the server name is correct
Step 2. Go to sql server connection wizard and try to connect with server name 
Step 3. Make sure the server is allowing remote connection
Step 4. Make sure the server is accessible to you by using ping command in CMD

I hope this will solve your problem
dipa ahuja replied to sangeetha vijayanandh on 13-Nov-11 05:31 AM

1. Make sure your database engine is configured to accept remote connections

2. Check the SQL Server service account

3. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your AS web P.NET application

4. You may need to create an exception on the firewall for the SQL Server instance and port you are using

5. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings

6. Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall for SQLBrowser.

7. 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 http://blog.edlington.net/post/251973765/resolving-a-network-related-or-instance-specific-error

Devil Scorpio replied to sangeetha vijayanandh on 13-Nov-11 07:21 AM
Hi,

Check the foolowing points tp resolve ur problem
  • Check the spelling of the SQL Server instance name that is specified in the connection string.

  • Use the SQL Server Surface Area Configuration tool to enable SQL Server to accept remote connections over the TCP or named pipes protocols. For more information about the SQL Server Surface Area Configuration Tool, see Surface Area Configuration for Services and Connections.

  • Make sure that you have configured the firewall on the server instance of SQL Server to open ports for SQL Server and the SQL Server Browser port (UDP 1434).

  • Make sure that the SQL Server Browser service is started on the server.

sangeetha vijayanandh replied to Devil Scorpio on 16-Nov-11 05:01 AM
Hi

Thank you to all.

The problem is solved.

I have just replaced the ( . ) by my server name . then it came out well

regards,
Sangeetha