我在myconn.Open()处得到一个错误;如何解决它。错误{“发生了网络相关或特定于实例的错误..”}
{"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:}
SqlConnection myconn = new SqlConnection();
String connection = "Data Source=SQLEXPRESS;AttachDbFilename=C:\\Users\\Winer\\Documents\\Visual Studio 2008\\WebSites1\\App_Data\\Database.mdf";
myconn.ConnectionString = connection;
myconn.Open();
有人可以这么说吗?
尝试\ SQLEXPRESS –
错误在线\t \t 1无法识别的转义序列\ SQLEXPRESS – user1334247
HTTP:// WWW。connectionstrings.com/是连接字符串的良好来源。 –