其他分享
首页 > 其他分享> > datatable删掉行的访问

datatable删掉行的访问

作者:互联网

删除当前行

  if (bind_Member.Position < 0)
                return;
  bind_Member.RemoveAt(bind_Member.Position);

删除行的访问,核心是通过DataRowVersion.Original访问删除后的行信息

dataTable = bind_Member.DataSource as DataTable;
 if (dataTable.GetChanges() == null)
   return;
 else
   {
       this.Text = dataTable.GetChanges().Rows.Count.ToString();
   }
 foreach (DataRow item in dataTable.GetChanges(DataRowState.Deleted).Rows)
   {
       this.Text += item[3, DataRowVersion.Original].ToString();
   }

 

标签:Rows,bind,删掉,DataRowVersion,dataTable,Member,访问,GetChanges,datatable
来源: https://www.cnblogs.com/imhuanxi/p/15780414.html