J
Jiho Han
I have a dataset loaded with an xml that looks like this:
<associations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<association>
<associationid>{8a3aca06-a7de-41a5-b584-063e7cf391bb}</associationid>
<createdon>2004-02-17T12:05:40.3430000-05:00</createdon>
<modifiedon>2004-02-17T12:05:40.3430000-05:00</modifiedon>
<forwardrelation>Parent</forwardrelation>
<backrelation>Parent</backrelation>
<forwardnotes>ttt</forwardnotes>
<backnotes/>
<fromid name="" dsc=""
type="1">{8c4a969b-2aa4-4679-b170-d9f6441f7c6d}</fromid>
<toid name="" dsc="" type="2">{df3f306f-19de-4f50-9784-623bf6693fa8}</toid>
<createdby name="" dsc=""
type="8">{2479254f-1dee-41dc-b79b-8de686a4db29}</createdby>
<modifiedby name="" dsc=""
type="8">{2479254f-1dee-41dc-b79b-8de686a4db29}</modifiedby>
</association>
</associations>
Then I try to merge another dataset loaded with another xml:
<resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contact>
<contactid>{1323159A-E579-4A9B-95A2-5F9AFC041E28}</contactid>
<fullname>Jones, Sally</fullname>
<jobtitle>Lawyer</jobtitle>
<accountid name="Jones&Jones"
dsc="0">{EE22734B-F1A1-4B0F-B874-52FE2A3B1A6A}</accountid>
</contact>
<contact>
<contactid>{DF3F306F-19DE-4F50-9784-623BF6693FA8}</contactid>
<fullname>Dodd, Cindy</fullname>
<jobtitle>Owner</jobtitle>
<accountid name="Suburban Cycle Shop"
dsc="0">{D17A8F20-D1D0-4F51-B365-92FDF16EDBE9}</accountid>
</contact>
<contact>
<contactid>{54B82B18-D54D-4B6B-B114-73093D2A0070}</contactid>
<fullname>Hayes, Scott</fullname>
<jobtitle>Primary Owner</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
<contact>
<contactid>{8929CAD1-E941-4B6E-AAB7-A3D3062A9C71}</contactid>
<fullname>Kennedy, Susan</fullname>
<jobtitle>Finance Workout</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
<contact>
<contactid>{AADC8B14-27F3-4B03-8901-FC0929D48544}</contactid>
<fullname>Block, Larry</fullname>
<jobtitle>Sales Turnaround</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
</resultset>
Using the following syntax:
associationDS.Merge(resultDS.Tables[0]); // assume the first xml has been
loaded into associationDS and the second into resultDS
There were no schemas involved and each DataSet is loaded via
ReadXml(XmlTextReader) method.
Things kind of work out ok as <contact> nodes are inserted right under
<associations> root so that it looks like:
<associations
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><association/><contact
/></assocations>
The only problem is that the resulting xml after the merge is missing
<accountid> node under <contact>.
What am I missing? Do I have to specify explicit schema info or
relationship - note that <association> and <contact> are seemingly
independant - ?
Thanks much!
Jiho
<associations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<association>
<associationid>{8a3aca06-a7de-41a5-b584-063e7cf391bb}</associationid>
<createdon>2004-02-17T12:05:40.3430000-05:00</createdon>
<modifiedon>2004-02-17T12:05:40.3430000-05:00</modifiedon>
<forwardrelation>Parent</forwardrelation>
<backrelation>Parent</backrelation>
<forwardnotes>ttt</forwardnotes>
<backnotes/>
<fromid name="" dsc=""
type="1">{8c4a969b-2aa4-4679-b170-d9f6441f7c6d}</fromid>
<toid name="" dsc="" type="2">{df3f306f-19de-4f50-9784-623bf6693fa8}</toid>
<createdby name="" dsc=""
type="8">{2479254f-1dee-41dc-b79b-8de686a4db29}</createdby>
<modifiedby name="" dsc=""
type="8">{2479254f-1dee-41dc-b79b-8de686a4db29}</modifiedby>
</association>
</associations>
Then I try to merge another dataset loaded with another xml:
<resultset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contact>
<contactid>{1323159A-E579-4A9B-95A2-5F9AFC041E28}</contactid>
<fullname>Jones, Sally</fullname>
<jobtitle>Lawyer</jobtitle>
<accountid name="Jones&Jones"
dsc="0">{EE22734B-F1A1-4B0F-B874-52FE2A3B1A6A}</accountid>
</contact>
<contact>
<contactid>{DF3F306F-19DE-4F50-9784-623BF6693FA8}</contactid>
<fullname>Dodd, Cindy</fullname>
<jobtitle>Owner</jobtitle>
<accountid name="Suburban Cycle Shop"
dsc="0">{D17A8F20-D1D0-4F51-B365-92FDF16EDBE9}</accountid>
</contact>
<contact>
<contactid>{54B82B18-D54D-4B6B-B114-73093D2A0070}</contactid>
<fullname>Hayes, Scott</fullname>
<jobtitle>Primary Owner</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
<contact>
<contactid>{8929CAD1-E941-4B6E-AAB7-A3D3062A9C71}</contactid>
<fullname>Kennedy, Susan</fullname>
<jobtitle>Finance Workout</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
<contact>
<contactid>{AADC8B14-27F3-4B03-8901-FC0929D48544}</contactid>
<fullname>Block, Larry</fullname>
<jobtitle>Sales Turnaround</jobtitle>
<accountid name="A&M"
dsc="0">{3ABC2121-5315-4050-838D-477E04B37CE7}</accountid>
</contact>
</resultset>
Using the following syntax:
associationDS.Merge(resultDS.Tables[0]); // assume the first xml has been
loaded into associationDS and the second into resultDS
There were no schemas involved and each DataSet is loaded via
ReadXml(XmlTextReader) method.
Things kind of work out ok as <contact> nodes are inserted right under
<associations> root so that it looks like:
<associations
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><association/><contact
/></assocations>
The only problem is that the resulting xml after the merge is missing
<accountid> node under <contact>.
What am I missing? Do I have to specify explicit schema info or
relationship - note that <association> and <contact> are seemingly
independant - ?
Thanks much!
Jiho