图中上边那个连接的字串是什么呢。是在用SQLEXPRESS?以下试试using (SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDBFilename=|DataDirectory|\Database1.mdf;Integrated Security=SSPI;User Instance=true"))