|
-
Nov 30th, 2009, 12:35 PM
#1
Thread Starter
Addicted Member
could not open a connection to sql server
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.
Thanks
Failing to plan is Planning to fail 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|