C
Campbell Wild
Hi,
I am trying a simple approach to updating a datatable.
I have a set query that I run on the database. This populates a
datatable, 'dtMyData'.
Every X seconds, I re-run the query and store in a separate datatable
'dtUpdated'. I then call dtUpdated.Merge(dtMyData). This successfully
updates my dtMyData datatable with the new rows from the requery.
My problem is, I want to know which rows are updated/changed/deleted.
Everything in the updated dtMyData has RowState set to 'Unchanged'. Why
don't the added rows from the Merge operation get set to 'Added'?
If I set the preserveChanges parameter of the Merge operation to True,
it marks all the rows as 'Modified'. Neither of these approaches seems
very useful to me.
Is there any way to just mark the modified/added/deleted rows in my new
table, so I'm able to call dtMyData.GetChanges?
Or is there a better way to do this?
Thanks,
Campbell
I am trying a simple approach to updating a datatable.
I have a set query that I run on the database. This populates a
datatable, 'dtMyData'.
Every X seconds, I re-run the query and store in a separate datatable
'dtUpdated'. I then call dtUpdated.Merge(dtMyData). This successfully
updates my dtMyData datatable with the new rows from the requery.
My problem is, I want to know which rows are updated/changed/deleted.
Everything in the updated dtMyData has RowState set to 'Unchanged'. Why
don't the added rows from the Merge operation get set to 'Added'?
If I set the preserveChanges parameter of the Merge operation to True,
it marks all the rows as 'Modified'. Neither of these approaches seems
very useful to me.
Is there any way to just mark the modified/added/deleted rows in my new
table, so I'm able to call dtMyData.GetChanges?
Or is there a better way to do this?
Thanks,
Campbell