November 30, 2009 at 10:34 am
I am using sql server 2005 and asp.net 2.0 in my home.
I established connection in my application and put code in page load
protected void Page_Load(object sender, EventArgs e)
{
string constring = "server=.\\SQLEXPRESS;uid=sa;pwd=;data source=dbAshok";
//Open the connection
sqlconnection = new SqlConnection(constring);
sqlconnection.Open();
string strquery = "select *from Employee";
dataset = new DataSet(strquery);
sqlconnection.Close();
}
But i got an error in open the connection. My error is below.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I couldn't fix this bugs. Please suggest me.
Hope yours reply.
December 1, 2009 at 6:33 am
By default SQL Server Express does not allow remote connections. Go into the SQL Server Configuration Manager and make sure you have either NamedPipes or TCP enabled in the SQL Server 2005 Network Configuration.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply