When i am trying to connect to SQL Server(Express edition) on production server i am getting the following error.
"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: TCP Provider, error: 0 - No such host is known.)"
My SQL connection string is like this which i wrote in web.config.
<add key="conn1" value="Data Source=xxx.xxx.x.xx\xyz,1433;Initial Catalog=abcdef_xyz;persist Security Info=true;User ID=xx;Password=xxxxxx"/>
string constr = ConfigurationManager.AppSettings["conn1"];
SqlConnection con = new SqlConnection(constr);
con.Open();
When i searched microsoft help to resolve this error, it suggested me to enable TCP/IP protocol for SQL server, i did that, but even after doing that i am still not able to connect to the database. Could any one please tell me what else i need to configure in order to connect to the database.
Thanks
Can you connect with management studio express? It may be that your connection string is wrong..
|||Hi tgopi99,
The error message indicates that the server is not reachable. Make sure you have specified the correct server name and also, make sure you can reach that ip address from your machine(do you have a firewall installed on your machine?)
No comments:
Post a Comment