473,465 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1515
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: jamait | last post by:
Hi all, I m trying to read in a text file into a datatable... Not sure on how to split up the information though, regex or substrings...? sample: Col1 Col2 ...
3
by: Patrick | last post by:
I have got 2 XML documents, both of which conform to the same XSD Schema, which define possible optional elements. The 2 XML documents contain 2 disjoint set of XML elements. What is the best,...
2
by: Emmett Power | last post by:
Hi, I have an Access table with a number of records which refer to the same person but with data in different fields. So for example the table would look like this: Name..............Field...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
15
by: PRadyut | last post by:
In this code it throws a runtime error on a code access violation . On the line z->data=p->data; while (p!=NULL && q!=NULL) { if (*s==NULL) {
3
by: Sanjib Biswas | last post by:
Hi All, I am looking for XML merging for the following scenarios. I want to load both the input files and show in the tree viewer and highlight the differences. Now its up to the user to select...
7
by: Jon Vaughan | last post by:
I have 2 datasets , one returned as a dataset from a webservice and one created client side form the same stored procedure that is returned from the webservice. I then try and merge the data, but...
31
by: louishong | last post by:
3rd time posting this as the first two simply disappeared! Here's the issue: We currently run an Access application in the West Coast for tracking resource centric data. For those located in the...
1
by: ebenl555 | last post by:
i am writing code to import data from an .xls file into a db using an oledbadapter to fill a datatable. I can access most of the values easily using this method. i do however have problems with a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.