MM你的Delete语句没有运行,当然显示不出修改后的结果,用SqlCommand.ExcuteNoQuery运行chaxun即可

解决方案 »

  1.   

    string chaxun1="delete from zcxx where 用户名='"+list+"'";
    string chaxun2="select * from zcxx";DataSet ds = new DataSet();
    SqlDataAdapter MyAdapter = new SqlDataAdapter(chaxun,myConn);
    SqlCommand MyCommand = new SqlCommand(chaxun,myConn);
    myconn.open();
    Mycommand.ExecuteNoQuery();
    MyAdapter.Fill(ds,"zcxx");
    zcxx.DataSource = ds;
    zcxx.DataMember = "zcxx";
    zcxx.DataBind();
    myconn.close();
      

  2.   

    string chaxun1="delete from zcxx where 用户名='"+list+"'";
    string chaxun2="select * from zcxx";DataSet ds = new DataSet();
    SqlDataAdapter MyAdapter = new SqlDataAdapter(chaxun2,myConn);
    SqlCommand MyCommand = new SqlCommand(chaxun1,myConn);
    myconn.open();
    Mycommand.ExecuteNoQuery();
    MyAdapter.Fill(ds,"zcxx");
    zcxx.DataSource = ds;
    zcxx.DataMember = "zcxx";
    zcxx.DataBind();
    myconn.close();哪里来的那么多MM,分只给一点点。