473,789 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>10 01</OrderNumber>
</Query1>
<Query1>
<Name>Bob</Name>
<OrderNumber>10 02</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>20 01</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>20 02</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 2620
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******** *********@newss vr24.news.prodi gy.com...
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>10 01</OrderNumber>
</Query1>
<Query1>
<Name>Bob</Name>
<OrderNumber>10 02</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>20 01</OrderNumber>
</Query1>
<Query1>
<Name>Helen</Name>
<OrderNumber>20 02</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
2047
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 there are several keys available. Each person has a key to open his/her room. Probably this key is able to open rooms of the group of this person.
1
3683
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 rs.addnew rs("a1")=... re.update when I associated this with hierarchical flexgrid I saw what I expected. On
2
1734
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 window, when you open it you have to use the windows scroll basr to see all of it. I'd like to switch to a Microsoft-like web site hierarchical menu. Tried several variations, but have the same problem. When you open a section most of it disappears off...
0
1262
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 Schematron, read up on XML design patterns and best practices, and thought I knew what I was doing. Since there was more overlap than not between the contents of the different transaction types, I designed a single schema with a single root, and...
3
5590
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 ms_id = ms_parent START WITH ms_id = 1 --> Result-set (example): ms_id parent_id 1 1.1 1 1.1.1 1.1 1.1.2 1.1 1.1.3 1.1 1.2 1 1.2.1 1.2
1
1799
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 me. My hierarchical structure has five levels which is store in table call level1, level2,… level5. Each level remember the parent ID e.g. level5 contains a column called level4ID. How should I implement it in order to get fastest loading?...
4
2610
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
2257
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 data model. What? A Yahoo-like drill-down menu that is a series of categories and nested categories is a hierarchical relational data model. An example can be seen at but the review of the query string values strongly indicates
3
2044
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 top level of the hierarchy) -- like message posts and their replies. Is there a built-in way to do this, or a generally accepted simplest way? My first idea was to create a user control like HierarchicalListing that contains a Repeater, and...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9984
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5418
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3701
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.