DataTable 使用 delete() 循环删除行的问题
DT 是表 有id 列
string[] id = new string[] { "11", "13" }; for (int i = 0; i < DT.Rows.Count; i++) { for (int j = 0; j < id.Length; j++) { if (DT.Rows[i]["id"].ToString() == id[j]) { DT.Rows[i].Delete(); // 不要使用 Remove(DT.Rows[i]) } } } //这里也不许+ DT.AcceptChanges() 因为还要提交