Legolas
What is the difference between DataRow.Delete() and DataRow.Remove()?
By Legolas in ADO.NET on Jul 05 2011
  • RMS
    Jul, 2011 23

    If delete() method is called on a row, after last Acceptchanges() was called,
    values are deleted but row exists in table and values can be recovered by using DataTable.Rejectchanges().
    DataRow.RowState become "deleted" and current values are are set to Null.

    The Delete method physically removes DataRow only if it was added to the DataTable since the last AcceptChanges() was called ,Otherwise,it sets RowState=RowState.Deleted and set current values to Null.

    Remove Method DataRowCollection physically removes dataRow and wont be recovered.

    However Remove Method does not effect datasource when Update Method Data Adapter is called , you need to call Delete Method of Data Row.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS