string strsql = @"Data Source=LINDUN-PC\\SQLEXPRESS;Initial Catalog =student;Integrated Security = True;";
SqlConnection con = new SqlConnection(strsql);if(con.State==ConnectionState.Open)
{
MessageBox.show("数据库打开")
}
出现的错误:con.Open()实例失败,为什么会出现这样的错误?
SqlConnection con = new SqlConnection(strsql);if(con.State==ConnectionState.Open)
{
MessageBox.show("数据库打开")
}
出现的错误:con.Open()实例失败,为什么会出现这样的错误?
.\SQLEXPRESS你已经用@,就不要两个\