How do you clear deltas in C# .NET DataAbstract adapter

I have a dataadapter on which I prepare row operations

Type is LinqDataAdapter

At some point I ask if the user wants to proceed and then perform

dataAdapterTags_.CancelChanges();

when the user answers ‘no’

When I redo the same operation the code complains when calling DeleteRow(record)

It appears the CancelChanges did not remote the delta list

It could be that it is a “Delete” (If I am not mistaken I fixed the issue for insert/edit with the cancelupdates)

workaround. replace

condata.dataAdapterTags_.CancelChanges();

with

var table = condata.dataAdapterTags_.GetTable<YourTagClass>();
for (int i = table.Changes.Count - 1; i >= 0; i--)
    table.RemoveChange(table.Changes[i]);

Logged as bugs://D19732.

Thanks for the info,

This is a dangerous bug for us.

A CancelChanges followed by an ApplyChanges might alter the DB too much, correct?

What does CancelChanges do in the buggy version?

What should it do in the fixed version? Rollback all inserts+updates+deletes?

bugs://D19732 was closed as fixed.

No. After CancelChanges, ApplyChanges has nothing to send. DB is not touched.

CancelChanges discards all pending inserts, updates and deletes. The bug is only that the same objects can’t be queued again afterwards: either an exception, or the change is silently not sent. The fix will be in the next release, planned for next week.

CancelChanges doesn’t restore property values you already changed on your objects. Re-fetch the rows if you need the original values.