SqlConnection con = new SqlConnection();
        //con.ConnectionString = "server=.;user id=sa;password=sasa";//普通的连接
        //con.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\数据库名称.mdf;Integrated Security=True;User Instance=True"; //注意哦,这里的mdf文件必须是没有附加上去的,其中的|DataDirectory|是代表项目中的App_Data(数据)目录
        con.ConnectionString = "Data Source=.\\;AttachDbFilename=D:\\bs\\App_Data\\ComputerWebsite.mdf;Integrated Security=True;User Instance=false";
        con.Open();