I cannot be sure yet, but I think with your help I found what is wrong. I
used to call AcceptChanges method every time I'm making changes in any
DataTable. I was thinking that this method will save my changes in the
DataSet only and without calling this method I will lose the changes I make.
I commented all AcceptChanges calls and now HasChanges seems to work
properly.
So for now I do not need to to worry about losing any change I make and I
just need to ask the user if he wants to save data into XML only in case
when HasChanges returns True.
Thank you very much
Al
"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:71**********************************@microsof t.com...
Al,
Have you tried calling the dataset's AcceptChanges method immediately
after
initially loading it? After that, HasChanges may correctly reflect changes
since loading.
Kerry Moorman
"Al" wrote:
>Unfortunately HasChanges method returns True even right after populating
DataSet from XML file. I do not know why.
I also tried to populate another DataSet with GetChanges method. No
success
too - the resulting DataSet has rows in Tables. Do not know why either.
Al
"Kerry Moorman" <Ke**********@discussions.microsoft.comwrote in message
news:29**********************************@microso ft.com...
Al,
The dataset has a HasChanges method that might work for you.
Kerry Moorman
"Al" wrote:
I'd like to know if there were any changes in the DataSet which was
populated by reading XML file. 6 DataTables with data or just
structure
with
no data inside of it.
I think about this scenario:
I create 2 datasets and populate both from the same XML file. Then the
first
one is used as DataSource for many controls and the second one is
untouched.
If there were some changes in the first one, I'd like to know it and
would
like to compare with the second one. I don't know how. Everything I
need
to
know is just were there any changes or not. If yes I will ask the user
if
he
wants to save them back into XML file.
So the question again: How do I compare 2 datasets? Or maybe somebody
can
suggest a better way to catch changes?
Thank you
Al