F
Fardreamer
I'm trying to add rows marked as deleted back into their parent
DataRowCollection by using DataRowCollection.Add. The behavior I was
expecting was having the DataRowState switch back to it's last value
before the delete, i.e. Unchanged->Deleted->Unchanged,
Modified->Deleted->Modified, etc. Instead I get an ArgumentException
with the message "This row already belongs to this table." Obviously
the row does belong to the table, however it is not currently part of
it's row collection.
How would I go about implementing this? I know I can use RejectChanges
but that will revert the state back to the last Original, which will
undo any field changes as well. All I want to do is undo the last
Delete action. I was considering adding a duplicate new row and loading
the deleted row's values into it, but that might result in constraint
violations when running the related stored procedures against the data
source.
Thanks in advance.
DataRowCollection by using DataRowCollection.Add. The behavior I was
expecting was having the DataRowState switch back to it's last value
before the delete, i.e. Unchanged->Deleted->Unchanged,
Modified->Deleted->Modified, etc. Instead I get an ArgumentException
with the message "This row already belongs to this table." Obviously
the row does belong to the table, however it is not currently part of
it's row collection.
How would I go about implementing this? I know I can use RejectChanges
but that will revert the state back to the last Original, which will
undo any field changes as well. All I want to do is undo the last
Delete action. I was considering adding a duplicate new row and loading
the deleted row's values into it, but that might result in constraint
violations when running the related stored procedures against the data
source.
Thanks in advance.