EndEdit does not wipe out the original version of the data in the dataset.
I think it pushes it from the control into the underlying dataset, which is
what you want, so you can look for teh differences. (If I'm wrong, I'm sure
someone will correct me.)
In a dataset, to see the rows that have changed, you can check the version
of the data using the DataViewRowState enumeration.
This shows the rows modified, with the new value:
DataViewRowState dvrs;
dvrs = DataViewRowState.ModifiedCurrent;
Console.WriteLine("Modified Rows");
//first param is filter, 2nd is sort, 3rd is recordstates
foreach (DataRow row in dt.Select("", "", dvrs))
Console.WriteLine(" {0}", row["CompanyName", DataRowVersion.Original]);
(I may have messed up my parentheses and square brackets there; I converted
this from a VB sample that I have.)
Robin S.
----------------------------------
"Rob Dob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How do I determine if there are any rows within the BindingSource that
> have changed prior to calling the EndEdit(). I need to do this in order
> to archive some records and if I call the EndEdit() then it also wipes
> out the orginal version of the dataset record with the proposed changes.,
> However I don't wish to iterate through every row in the dataset in order
> to figure out changes, Does the BindingSource not have something similar
> to the GetChanges() or HasChanges()
>
> Thanks in advance.
>
>
|