private void del_bt_Click(object sender, EventArgs e) { int[] aa = manuser.GetSelectedRows(); foreach (int testa in aa) { DataRow drt = manuser.GetDataRow(testa); string id = drt["ID"].ToString(); del_list.Add(Convert.ToInt32(id)); manuser.DeleteRow(testa); } // MessageBox.Show(aa.Length.ToString()); return; DataRow a = manuser.GetDataRow(manuser.FocusedRowHandle); Maticsoft.BLL.username use = new Maticsoft.BLL.username(); use.Delete(Convert.ToInt32(a["id"])); //MessageBox.Show(a["id"].ToString()); MessageBox.Show("删除成功"); Maticsoft.BLL.username usec = new Maticsoft.BLL.username(); DataSet ds = usec.GetAllList(); users_gc.DataSource = ds.Tables[0]; //DataSet ds = use.GetList(" "); //DataTable dt = ds.Tables[0]; //MessageBox.Show(ds.Tables.Count.ToString()); //DataTable dt = ds.Tables[0]; //MessageBox.Show(dt.Rows.Count.ToString()); }
private void buttonX2_Click(object sender, EventArgs e) { Maticsoft.BLL.username use = new Maticsoft.BLL.username(); foreach (int del_index in del_list) { use.Delete(del_index); } DataSet ds = use.GetAllList(); users_gc.DataSource = ds.Tables[0]; }