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

VB.NET 2005 & XML

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.

Mar 6 '06 #1
6 1097
Rzaleski,

Not with one statement.

Have a look to this on our website

http://www.vb-tips.com/default.aspx?...3-8a9529b2b38b

I hope this helps,

Cor

<rz******@gmail.com> schreef in bericht
news:11********************@z34g2000cwc.googlegrou ps.com...
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.

Mar 6 '06 #2
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

Mar 6 '06 #3
>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
Mar 6 '06 #4
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.

Mar 6 '06 #5
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
Mar 7 '06 #6
I am getting the following error:

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

Mar 7 '06 #7

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

Similar topics

1
by: amber | last post by:
Hello, I've just upgraded to VS.NET 2005 and SQL Server Express 2005. I converted my 2003 project into 2005. Now, when I try to run it, I get the error message: A first chance exception of...
0
by: Rob R. Ainscough | last post by:
I'm migrating my VS 2003 .NET CR reports to VS 2005 .NET and the task is not going well. Error: "Failed to load database information." "The database DLL crdb_fielddef.dll could not be...
9
by: Neil | last post by:
We have an Access 2000 MDB with a SQL 7 back end. We are upgrading SQL Server to SQL 2005, and are considering upgrading to Access 2003. Someone mentioned that they had heard about some...
1
by: Craig | last post by:
Hi All, We have a Visual Basic 6.0 application that we need to communciate with Sql Server 2005. In the past we had to use the microsoft.visualbasic.compatibility.dll to allow this software to...
1
by: Charles MacLean | last post by:
I want to install SQL on the same machine as VS 2005 Pro for development. While trying to install the version of SQL that comes with the VS 2005 Pro I'm getting error messages and the SQL engine...
3
by: shil | last post by:
Can I have both 1.1 and 2.0 frameworks installed on same machine? I have 2005 already, for some reason I had to install 2003. When I try to create a new project in 2003, I get an error as below: ...
4
by: JoeyD | last post by:
With SQL 2005, did Microsoft introduce login triggers? I seem to remember hearing something about it but, I don't remember exactly what I heard. Thanks, JD
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...

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.