473,399 Members | 3,302 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,399 software developers and data experts.

DataSet: Nested Tables in XML

Hi all

I got some trouble with creating XML Files.

I have a DataSet with two tables (Calendar and holidays)
and a Relationship (Nested = true) between both tables ("name").

When I now write the XML I get:
<Static>
<Calendar>
<name>AED</name>
<holidays>
<name>AED</name>
<holiday>2008-12-08</holiday>
</holidays>
<holidays>
<name>AED</name>
<holiday>2008-12-10</holiday>
</holidays>
</Calendar>
</Static>

What I need is this:
<Static>
<Calendar>
<name>AED</name>
<holidays>
<holiday>2008-12-08</holiday>
<holiday>2008-12-10</holiday>
</holidays>
</Calendar>
</Static>

Does anybody knows how this can be done ??

Thanks a lot for any comments.

Best regards
Frank

Oct 28 '08 #1
1 4257
DataSet xml is best used with relational tables...and not nesting.

You can use this trick if necessary:

http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!148.entry


"Frank Uray" <Fr*******@discussions.microsoft.comwrote in message
news:01**********************************@microsof t.com...
Hi all

I got some trouble with creating XML Files.

I have a DataSet with two tables (Calendar and holidays)
and a Relationship (Nested = true) between both tables ("name").

When I now write the XML I get:
<Static>
<Calendar>
<name>AED</name>
<holidays>
<name>AED</name>
<holiday>2008-12-08</holiday>
</holidays>
<holidays>
<name>AED</name>
<holiday>2008-12-10</holiday>
</holidays>
</Calendar>
</Static>

What I need is this:
<Static>
<Calendar>
<name>AED</name>
<holidays>
<holiday>2008-12-08</holiday>
<holiday>2008-12-10</holiday>
</holidays>
</Calendar>
</Static>

Does anybody knows how this can be done ??

Thanks a lot for any comments.

Best regards
Frank

Oct 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: tom | last post by:
hello, i have seen multiple postings on the subject but no answer that addresses my question: I create a dataset using a xsd schema. the schema specifies a relation from one of the tables to...
2
by: Wayne Wengert | last post by:
I am attempting to generate an XML file based on the contents of a dataset which contains a parent-child relationship but when I create the output file all I get is the XML header as shown here: ...
2
by: James Ankrom | last post by:
Why does this fail? Dim relResources As New Data.DataRelation("Application_Resources", ..Tables("User_Applications").Columns("Application_id"),...
0
by: Steve | last post by:
I have a dataset. I fill it with two recordsets from SQL queries. Tables are called tblPlanFYSpendingStage, tblSpendingStage.
0
by: George Durzi | last post by:
I have a DataSet with 3 tables, and two DataRelations dsSubs.Tables.TableName = "Subscriptions" dsSubs.Tables.TableName = "AccountManagers" dsSubs.Relations.Add "AccountManagers_Subscriptions",...
1
by: DaveF | last post by:
How can I retrieve display_names Dim custDS As DataSet = New DataSet Dim mySQL, mySQL2, mySQL3 As String
12
by: Graham Blandford | last post by:
Hi all, Would someone be able to tell me the most 'graceful' way of removing unwanted rows from a dataset based on a condition prior to update? OR, resetting the rows all to unchanged after they...
2
by: Henrik | last post by:
Hi, I'm really stuck with this one. I have a dataset with two tables. One table is company data, and the other is contacts. I populate these by using a SP in SQL Server which returns the two...
3
by: leviwatts | last post by:
Exception Details: System.ArgumentException: DataTable already belongs to another DataSet. Googling for this error shows several post of people trying to manipulate a table within a dataset. Others...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...

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.