473,231 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 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 1495
> 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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...

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.