Why did a network-related or instance-specific error occur while establishing a connection to SQL Server?
Your connection string was probably overriden when you copied your new website version on the server. Please check the connection string in web.config and see if it is valid.
If you are connecting from Windows Machine A to Windows Machine B (server with SQL Server installed) and are getting this error, you need to do the following:
On Machine B:
- Turn on the Windows service called "SQL Server Browser" and start the service
- In Windows Firewall:
- enable incoming port UDP 1434 (in case SQL Server Management Studio on machine A is connecting or a program on machine A is connecting)
- enable incoming port TCP 1433 (in case there is a telnet connection)
- In SQL Server Configuration Manager:
- enable TCP/IP protocol for port 1433
I've resolved the issue. It was due to the SQL browser service.
Solution to such problem is one among below -
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.
link - http://www.microsoft.com/products/ee/transform.aspx?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1
check forthe followings :
Make sure your database engine is configured to accept remote connections
• Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration • Click on Surface Area Configuration for Services and Connections • Select the instance that is having a problem > Database Engine > Remote Connections • Enable local and remote connections • Restart instance
- 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