EndCurrentEdit causes the dataset.HasChanges() become TRUE

D

dev guy

Hi

I have a form and controls (no datagrid) on it bound to a typed dataset.
On Save button ... I have called EndCurrentEdit and then ds.HasChanges().
Even though no changes are made to the fields on the form, the call to
EndCurrentEdit() causes ds.HasChanges() to become TRUE.

If I do not call EndCurrentEdit() , then even if I do make changes into the
form fields, the HasChanges() remains FALSE.

can somebody throw some light on the same?

warm regards
 
M

Miha Markic [MVP C#]

Hi,

There is a CurrencyManager that with help from DataRow holds intermediate
values before commiting - that's why you don't see HasChanges before you
commite those values (either by calling EndCurrentEdit or moving Position).
If you don't want to raise HasChanges then you might use CancelCurrentEdit
method instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top