Undo DataRow.Delete?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Craig Buchanan

    Undo DataRow.Delete?

    I would like to set the RowState from Deleted to Unchanged on specific rows,
    without calling RejectChanges. I have a feeling that if I enumerate the
    collection, the Deleted rows will not be in the collection. Will FindRow
    exhibit the same behavior? What would be a good way to approach this?

    Thoughts?

    Thanks,

    Craig Buchanan


  • Alec MacLean

    #2
    Re: Undo DataRow.Delete?

    Not sure you can take that particular approach, but my initial thought was
    to perhaps consider using a cloned dataset so you can "restore" from it.
    May depend on the size of your dataset and app memory requirments, etc, as
    to whether that's reasonable to do or not.


    "Craig Buchanan" <someone@micros oft.comwrote in message
    news:O0213Ha7IH A.1952@TK2MSFTN GP02.phx.gbl...
    >I would like to set the RowState from Deleted to Unchanged on specific
    >rows, without calling RejectChanges. I have a feeling that if I enumerate
    >the collection, the Deleted rows will not be in the collection. Will
    >FindRow exhibit the same behavior? What would be a good way to approach
    >this?
    >
    Thoughts?
    >
    Thanks,
    >
    Craig Buchanan
    >

    Comment

    • Steve Gerrard

      #3
      Re: Undo DataRow.Delete?

      Craig Buchanan wrote:
      I would like to set the RowState from Deleted to Unchanged on
      specific rows, without calling RejectChanges. I have a feeling that
      if I enumerate the collection, the Deleted rows will not be in the
      collection. Will FindRow exhibit the same behavior? What would be a
      good way to approach this?
      Do you mean not calling RejectChanges on the whole table?
      You can RejectChanges on individual rows, you don't have to do them all.

      For any row, a datatable is basically hanging on to two versions: the original
      and the currrent. It does not, for instance, save edits to the row made before
      it was deleted. If you have deleted a row, then you can either leave it like
      that, or get back the original using RejectChanges on that row.


      Comment

      • Craig Buchanan

        #4
        Re: Undo DataRow.Delete?

        I was able to use the DataRow.Item(co lumnName, DataRowVersion. Original) for
        my purposes.

        "Craig Buchanan" <someone@micros oft.comwrote in message
        news:O0213Ha7IH A.1952@TK2MSFTN GP02.phx.gbl...
        >I would like to set the RowState from Deleted to Unchanged on specific
        >rows, without calling RejectChanges. I have a feeling that if I enumerate
        >the collection, the Deleted rows will not be in the collection. Will
        >FindRow exhibit the same behavior? What would be a good way to approach
        >this?
        >
        Thoughts?
        >
        Thanks,
        >
        Craig Buchanan
        >

        Comment

        Working...