473,394 Members | 1,806 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,394 software developers and data experts.

produce a truly hierarchical xml

Any help appreciated.

I have two Access tables, customer and orders. I would like to create a
truly hierarchical xml file form the joined tables. I need to produce:

<Query1>
<Customer>
<Name>Bob</Name>
<Order>
<ID>1001</ID>
</Order>
<Order>
<ID>1002</ID>
</Order>
</Customer>
<Customer>
<Name>Helen</Name>
<Order>
<ID>2001</ID>
</Order>
<Order>
<ID>2002</ID>
</Order>
</Customer>
/<Query1>

Just exporting the joined query gives me.

<Query1>
<Name>Bob</Name>
<OrderNumber>1001</OrderNumber>
</Query1>
<Query1>
<Name>Bob</Name>
<OrderNumber>1002</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>2001</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>2002</OrderNumber>
</Query1>

Anybody have a routine or references to produce a truly hierarchical xml
file for a joined relational database.

Thank you,
DJ


Nov 12 '05 #1
1 2573
Hi,

Load both tables separately as DataTables into DataSet. Then create a
DataRelation between the DataTables. And be sure to set DataRelation's
Nested property to true. After you have done this, get the XML out from
DataSet by using GetXml or WriteXml methods.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"News Server" <da****@bhpeng.com> wrote in message
news:na*****************@newssvr24.news.prodigy.co m...
Any help appreciated.

I have two Access tables, customer and orders. I would like to create a
truly hierarchical xml file form the joined tables. I need to produce:

<Query1>
<Customer>
<Name>Bob</Name>
<Order>
<ID>1001</ID>
</Order>
<Order>
<ID>1002</ID>
</Order>
</Customer>
<Customer>
<Name>Helen</Name>
<Order>
<ID>2001</ID>
</Order>
<Order>
<ID>2002</ID>
</Order>
</Customer>
/<Query1>

Just exporting the joined query gives me.

<Query1>
<Name>Bob</Name>
<OrderNumber>1001</OrderNumber>
</Query1>
<Query1>
<Name>Bob</Name>
<OrderNumber>1002</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>2001</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>2002</OrderNumber>
</Query1>

Anybody have a routine or references to produce a truly hierarchical xml
file for a joined relational database.

Thank you,
DJ

Nov 12 '05 #2

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

Similar topics

2
by: Reimar Bauer | last post by:
Hi all, I would like to use a hierarchical group oriented encryption. Is there something implemented or did you know something I could use? For explanaition. If you have a large building...
1
by: ALEX KLEIN | last post by:
I want to use fabricated hierarchical recordset in VB6 using ADO. I wrote code like dim rs as adodb.recordest set rs=new adodb.recordest rs.fields.append "a1",adChar,30 Then in loop I put...
2
by: Dennis Allen | last post by:
Hi. I've been using a simple css based outline on my web site. A section of hyperlinks within <div class>, imitating open/closed folders. Problem. Since the folder is on the lower left of the...
0
by: Steve Jorgensen | last post by:
I recently produced an XML Schema to support several kinds of transactions within a particular business domain. In the process, I learned pretty much all of how W3C XML Schema works, learned some...
3
by: Cláudia Morgado | last post by:
Hello! Oracle has the option with the SQL CONECT BY statement to run through a hierarchical database with a single SQl-statement: <!--SQL SELECT ms_id,ms_parent FROM messages CONNECT BY PRIOR...
1
by: jayson_13 | last post by:
Hi, I want to retrieve the hierarchical structure which is store inside the database and then display it using treeview control. But now I got a design issue which I hope that you guys can help...
4
by: Daisy | last post by:
Let's say I've got a forum, where users can be moderators of each forum. Tables look like this: USER -------- user_key name FORUM
5
by: clintonG | last post by:
I'm looking for documentation and would not turn my nose up to any code from anybody who thinks they are good at the design of an algorythm that can be used to generated a hierarchical relational...
3
by: Bennett Haselton | last post by:
I want to display a hierarchical listing of items from a database table, where, say, each row in the table has an "ID" field and a "parent_id" field giving the ID of its parent (NULL if it's at the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...

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.