I am not able to connect to SqlServer 2005
Hi All,
I am trying to connect to SqlServer 2005 whihc is running on another machine. But it is giving error. ie.
"
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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
"
this si my connection string information
//SqlConnection cn = new SqlConnection("Server=id03;uid=sa;pwd=infokall;database=TestDB");
SqlConnection cn =newSqlConnection(conn);SqlCommand cmd =newSqlCommand();string Value;string query = sqlInfo.SQL;cmd.CommandType =
CommandType.Text;cmd.Connection = cn;
cmd.CommandText = query;
if (Convert.ToInt32(cn.State) == 0)cn.Open();
Value = cmd.ExecuteNonQuery().ToString();
// return Value;Response.Write(Value);
plz help me out.
Regards
Raju

