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)
{ string strsql, strcon; strcon = "Data Source=(1-pc);Initial Catalog=neww.mdf;Integrated Security=true"; SqlConnection con = new SqlConnection(strcon); SqlCommand cmdclasf; strsql = "create database product"; con.Open(); cmdclasf = new SqlCommand(strsql, con); int count = cmdclasf.ExecuteNonQuery(); con.Close(); if (count == 0) Label1.Text = "not create"; else Label1.Text = "created"; }
ConnectionString
UDL
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)