VB.NET 2005 & XML

  • Thread starter Thread starter rzaleski
  • Start date Start date
R

rzaleski

I want to create an application that reads an xml diagram. Due to the
heirachical nature of xml, when I
read the file into a dataset, I get two tables. Is there a way I can
flatten the tables, so I go from this:

Table1:

NAME
Ryan
Jake

Table2:

JOB DATE
Paper March
Homework April
Other May

To this:

NAME JOB DATE
Ryan Paper March
Ryan Homework April
Jake Other May

Also, I want to make sure I can save it in the proper format
(heirarchical).

Thanks.
 
I understand how to do a relation in a datatable, but my problem is,
when the xml is read in, two tables are created. These two tables do
not share a column. One table has name and the other has job and date.

Ryan
 
I understand how to do a relation in a datatable, but my problem is,
when the xml is read in, two tables are created. These two tables do
not share a column. One table has name and the other has job and date.
And the sample has that as well, One table has the names and one table has
the states.

Cor
 
You see, you are adding a column and creating the relation based on
that. If I am fed an XML file, I do not know the relations beforehand.
Is there any other ways of doing this? When I call
ds.ReadXML("myfile.mxl") it reads the data into 3 tables instead of one.
 
rzaleski,

If you are absolute sure that the pairs are equal, than you can add to both
a column and loop through both and add the index as key (Internaly of
course).

Than you can use the showed sample.

I doubt that these two tables without key will work.

Cor
 
I am getting the following error:

Cannot add a nested relation or an element column to a table containing
a SimpleContent column.
 
Back
Top