Followup XML Question

P

Peter

I guess I really don't understand how the values get arranged from an XML
file into a dataset, nor how to get them out again.

Can someone please, please give me a detailed explanation of how this simple
XML file would be processed, i.e. the tables would be x, the rows would be y
and the columns would be z?

<doc>
<table name="table1">
<row data="data1" />
<row data="data2" />
<row data="data3" />
</table>
<table name="table2">
<row data="data4" />
<row data="data5" />
<row data="data6" />
</table>
</doc>

Or is there a way to merely dump the contents of a dataset in a
human-readable format? That would be the best of all. Right now I'm picking
through this thing blindly, not knowing how it's put together, and running
into walls on all four sides.
 
C

Cor Ligthert [MVP]

Peter,

An XML file as you call it does not exist. XML is a notation to describe
files, that can be documents, or all other things by instance a serialized
XML format of a database as you use it, the dataset.

A dataset is a kind of representation of an SQL database. It is a complex of
wrappers (as well classes) and other classes used in it. To call the mostly
used.

The DataSet itself which is the wrapper around everything.
The DataTable: the tables which holds data is in that dataset (can be added
too)
The DataRelation; the relation between those tables is in the dataset as
well
The Columns; which describes the columns are in the tables (can be added
too)
The Rows; are in the Tables.
The Rows; holds by instance beside row information as the errorstatus the
itemarray, which gets their description from the columns.

To write a complete not strongly typed dataset we get it in the way as it is
mostly done

ds.Tables(name|index).Rows(index).Items(columns|name|index)

You can make from this by hand or with a kind of generator a strongly typed
dataset from this.
The advance of that is, that you are better protected against writting
typing errors. The generators make as far as I know all the same kind of
code. (Just a xxxx.vb file).

ds.TableName(rowIndex).Columname

However you can never point a row by a name.

I hope that this gives some idea's?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top