为什么我的有时候调用DataSet_1.Tables["表名"].Rows.ReMove删除行以后,还能访问到刚刚删除
的行(行状态为Delete),而有时候则根本就访问不到我刚刚删除的行...
我的访问语句为Foreach( DataRow row_ii in  DataSet_1.Tables["表名"].Rows )

解决方案 »

  1.   

    did you call AcceptChanges() on the DataTable or DataSet or call Update on the DataAdapter? show your code?
      

  2.   

    一经调用ReMove以后,就访问不到状态为Delete的行,我的程序还非的访问状态为Delete的行
      

  3.   

    if you doDataTable.Rows.Remove, the DataRow is gone from the Rows collection, of course, you can no longer access it in Rows collectionuse DataRow.Delete
      

  4.   

    .Remove 只影响 Dataset 内的 Table 不会把改变写进伺服器
    要再用 AcceptChanges 去把改变写进伺服器才行