473,320 Members | 2,054 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,320 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 2067
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.