471,624 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,624 software developers and data experts.

READING/MERGING XML DATA

Whew, I've struggled my way through figuring out how to use XML to transport
data..now I can imagine what having a baby is like :)

But, I'm stuck now. I generate the XML (single table, no indexes) and
populate a dataset using READXML. I then merge the contents of that DS (call
it DS1) with a second DS (call it DS2) that I've created on the form that
will be used to process the data transfer. I did that so my SQL would be
generated (I thought I was making my life easier). Well, it turns out that
the row state of the rows in DS2 are set to UNCHANGED after the data from DS1
are merged, so the inserts never happen when I do a DA.UPDATE(DS2). I clear
DS2 before the merge, by the way, so there are no existing rows prior to the
merge.

Any help would be very much appreciated!
Jul 21 '05 #1
2 1403
> I clear DS2 before the merge, by the way, so there are no existing rows prior to the merge.

I wonder, why are you merging datasets if you have cleared one of them? Doesn't that defeat the purpose?

btw..

If you merge, lets say ds1 with ds2, using ds2.Merge(ds1, true)
then ds2.HasChanges() will return true if :

ds2.HasChanges() returned true before the merge
or
ds1.HasChanges() returned true before the merge.

If AcceptChanges has been called prior to the merge on both datasets, then ds2.HasChanges() will return false. In other words,
merging does not affect the state of the rows.

Using an adapter to fill the data, i.e. SqlDataAdapter1.Fill(DataSet1), will automattically call AcceptChanges for you.

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Klatuu" <Kl****@discussions.microsoft.com> wrote in message news:1A**********************************@microsof t.com...
Whew, I've struggled my way through figuring out how to use XML to transport
data..now I can imagine what having a baby is like :)

But, I'm stuck now. I generate the XML (single table, no indexes) and
populate a dataset using READXML. I then merge the contents of that DS (call
it DS1) with a second DS (call it DS2) that I've created on the form that
will be used to process the data transfer. I did that so my SQL would be
generated (I thought I was making my life easier). Well, it turns out that
the row state of the rows in DS2 are set to UNCHANGED after the data from DS1
are merged, so the inserts never happen when I do a DA.UPDATE(DS2). I clear
DS2 before the merge, by the way, so there are no existing rows prior to the
merge.

Any help would be very much appreciated!

Jul 21 '05 #2
> I clear DS2 before the merge, by the way, so there are no existing rows prior to the merge.

I wonder, why are you merging datasets if you have cleared one of them? Doesn't that defeat the purpose?

btw..

If you merge, lets say ds1 with ds2, using ds2.Merge(ds1, true)
then ds2.HasChanges() will return true if :

ds2.HasChanges() returned true before the merge
or
ds1.HasChanges() returned true before the merge.

If AcceptChanges has been called prior to the merge on both datasets, then ds2.HasChanges() will return false. In other words,
merging does not affect the state of the rows.

Using an adapter to fill the data, i.e. SqlDataAdapter1.Fill(DataSet1), will automattically call AcceptChanges for you.

--
Dave Sexton
dave@www..jwaonline..com
-----------------------------------------------------------------------
"Klatuu" <Kl****@discussions.microsoft.com> wrote in message news:1A**********************************@microsof t.com...
Whew, I've struggled my way through figuring out how to use XML to transport
data..now I can imagine what having a baby is like :)

But, I'm stuck now. I generate the XML (single table, no indexes) and
populate a dataset using READXML. I then merge the contents of that DS (call
it DS1) with a second DS (call it DS2) that I've created on the form that
will be used to process the data transfer. I did that so my SQL would be
generated (I thought I was making my life easier). Well, it turns out that
the row state of the rows in DS2 are set to UNCHANGED after the data from DS1
are merged, so the inserts never happen when I do a DA.UPDATE(DS2). I clear
DS2 before the merge, by the way, so there are no existing rows prior to the
merge.

Any help would be very much appreciated!

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by jamait | last post: by
3 posts views Thread by Patrick | last post: by
2 posts views Thread by Emmett Power | last post: by
15 posts views Thread by PRadyut | last post: by
3 posts views Thread by Sanjib Biswas | last post: by
7 posts views Thread by Jon Vaughan | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.