A network-related or instance-specific error occurred

Hi there.! I've been working on our Software Analysis Development project for how many days and sleepless nights, the application is an Online Shopping. I'm using Microsoft Visual Studio 2010 as my environment, then I used C# as language for the site. I used Microsoft SQL 2008 R2 as my server and I made Database on the SQL Sever Management Studio named chenezboutique.mdf, with the tables namely dbo.login, dbo.cart, dbo.userdetails, dbo.dresses.

When I log in as administrator on the Log In page (Log In.aspx), there is an error shown on the response and I can't continue with it. As well as when I run the other pages with similar codes, the same error was shown:

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)

Source Error:

Line 25: SqlConnection con = new SqlConnection("Data Source=./SQLEXPRESS;Initial Catalog=chenezboutique;Integrated Security=SSPI;");
Line 26: SqlCommand com = new SqlCommand("select * from login", con);
Line 27: con.Open();
Line 28: if (con.State == ConnectionState.Open)
Line 29: {

I appreciate all help then, please..

0 answers