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

Problem generating XML from dataset

I need to generate an xml document from several datatables in a
dataset which was loaded from SQL Server. There are several
parent-child relationships between these tables. Thanks to some
previous help here, I'm able to convert the data set into xml with the
child nodes being nested under the parent nodes; but the problem is
that the child nodes contain the parent's primary key values. How can
I get rid of these values or hide them from the get go? Because the
values are being nested, they shouldn't be required (and I don't want
them).

For instance:

If have a two tables Person(PersonID, Name) and Home(HomeID, PersonID,
HomeName), I would like to get a document as follows:

<Person>
<PersonID>12</PersonID>
<Name>Joe</Name>
<Home>
<HomeID>12</HomeID>
<HomeName>Shangrila</HomeName>
</Home>
</Person>

but all I'm able to generate is:

<Person>
<PersonID>12</PersonID>
<Name>Joe</Name>
<Home>
<HomeID>19</HomeID>
<PersonID>12</PersonID>
<HomeName>Shangrila</HomeName>
</Home>
</Person>
Nov 12 '05 #1
1 2072
A perfect case for XSLT
"Mathew Relick" <ti****@yahoo.com> wrote in message
news:dd**************************@posting.google.c om...
I need to generate an xml document from several datatables in a
dataset which was loaded from SQL Server. There are several
parent-child relationships between these tables. Thanks to some
previous help here, I'm able to convert the data set into xml with the
child nodes being nested under the parent nodes; but the problem is
that the child nodes contain the parent's primary key values. How can
I get rid of these values or hide them from the get go? Because the
values are being nested, they shouldn't be required (and I don't want
them).

For instance:

If have a two tables Person(PersonID, Name) and Home(HomeID, PersonID,
HomeName), I would like to get a document as follows:

<Person>
<PersonID>12</PersonID>
<Name>Joe</Name>
<Home>
<HomeID>12</HomeID>
<HomeName>Shangrila</HomeName>
</Home>
</Person>

but all I'm able to generate is:

<Person>
<PersonID>12</PersonID>
<Name>Joe</Name>
<Home>
<HomeID>19</HomeID>
<PersonID>12</PersonID>
<HomeName>Shangrila</HomeName>
</Home>
</Person>

Nov 12 '05 #2

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

Similar topics

0
by: ericlok | last post by:
ERROR: "There were prolems generating Binding_Data.DataSet1. To resolve this problem, build the project, fix any errors, and then generate the dataset again.") * Tried to build the project, no...
7
by: Zachary Hilbun | last post by:
The below is some test code to help me learn how to update a dataset. It is supposed to read the value of UserCounter and write it back. The UserCounter is being read correctly as 0, is 1 when...
1
by: xxxxyz | last post by:
Hi, I want to generate dataset class using Visual studio ( I can do this as first generate SqlDataAdaptor and SqlConnection). But can I ganerate it without sqldataadaptor and sqlconnection,...
0
by: A P | last post by:
Hi! I use OleDbDataAdapter to create connection and when I select "Generate Dataset from that, I receive an error message saying : "There was problems generating <project>.Dataset1. To resolve...
8
by: ssdangelo | last post by:
Dear Sir - I have spent several days (p/t) trying to create a Dataset using V.B. Net on my Laptop Sony. I have tried using both a Access and a SQL Server database and the same problem occurs. I...
1
by: J. Askey | last post by:
I am implementing a web service and thought it may be a good idea to return a more complex class (which I have called 'ServiceResponse') in order to wrap the original return value along with two...
8
by: Thirsty Traveler | last post by:
I have a dataset that is returned from a sql server select that contains metadata and a cached dataset saved in an xml column. I would like to recover the dataset for use in generating a crystal...
0
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello Gurus, I produced an RDLC file with 3 tables. My application holds a DataSet with 3 kind of tables. I'm generating Visual Studio 2005 report for the 3 tables in the DataSet. I'm using the...
1
by: rhbourne | last post by:
Hello, I'm doing something wrong here, and it's driving me nuts. A very strange thing is happening with a query that populates an XML export function. 1. I have a query and its XML export...
6
by: shashi shekhar singh | last post by:
Respected Sir, I have to create multiple dynamic dropdownlist boxes and add items dynamically in <asp:table> server control but problem occurs , i.e. except of fist dropdown list no dropdownlist...
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: 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...
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
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
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...

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.