Sunday, February 26, 2012

Error connecting Database Server

Hi,

I am getting the following error when i am trying to connect to the database server installed on different box.

"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)"

When i searched google, some postings suggested to enable the TCP/IP and Named Pipes Protocols from SQL Server configuration Manager. I did so and also ran mofcomp command. But even after doing this i am not able to connect to the server. Following is my connection string.

<add key="conn2" value="Data Source=xxx\xxxxx;Initial Catalog=xxxxxx_xxxxxx;User ID=xx;Password=xxxxxx;"/>

Could any one please tell me what else the configuration settings i need to do in order to connect to the database from my application.

There are a couple of things to look at

1/. ensure your SQL Server 2005 instance allows remote connections

2/. make sure your firewall is not blocking any incoming connections

No comments:

Post a Comment