Hi all,

I have a small problem in writing XML file from VB.net. I am trying to write
the XML file using dataset.
I am able to write the XML in sequential way(one node after other). I can
write in the hierarchial(tree) structure also but only by using datagrid.
But I would like to write the XML file without using datagrid but just the
grid.

I am sending the sample. Could u please tell me how I can write
hierarchially using dataset but without using the datagrid.

Best regards,
Kelly

Re: Writing XML file by Cor

Cor
Wed Jan 07 05:10:00 CST 2004

Hi Kelly,

A sample I made yesterday and therefore I only had to change a little bit.

I hope this helps,

Cor

\\\
'Make a datatable with 8 columns
Dim ds As New DataSet
Dim dt As New DataTable("scorpion")
For i As Integer = 0 To 7
Dim dc As New DataColumn(Chr(i + 65))
dt.Columns.Add(dc)
Next
'And 12 rows every column filled with a value
For i As Integer = 0 To 11
dt.Rows.Add(dt.NewRow)
For y As Integer = 0 To dt.Columns.Count - 1
dt.Rows(i)(y) = y.tostring
Next
Next
ds.Tables.Add(dt)
ds.WriteXml("C:\scorpion.xml")
///

> I have a small problem in writing XML file from VB.net. I am trying to
write
> the XML file using dataset.
> I am able to write the XML in sequential way(one node after other). I can
> write in the hierarchial(tree) structure also but only by using datagrid.
> But I would like to write the XML file without using datagrid but just the
> grid.
>
> I am sending the sample. Could u please tell me how I can write
> hierarchially using dataset but without using the datagrid.



Re: Writing XML file by Kelly

Kelly
Thu Jan 08 05:09:21 CST 2004

Thanks Cor, You've been great help!!
"Cor" <non@non.com> wrote in message
news:OrhkH8Q1DHA.3220@tk2msftngp13.phx.gbl...
> Hi Kelly,
>
> A sample I made yesterday and therefore I only had to change a little bit.
>
> I hope this helps,
>
> Cor
>
> \\\
> 'Make a datatable with 8 columns
> Dim ds As New DataSet
> Dim dt As New DataTable("scorpion")
> For i As Integer = 0 To 7
> Dim dc As New DataColumn(Chr(i + 65))
> dt.Columns.Add(dc)
> Next
> 'And 12 rows every column filled with a value
> For i As Integer = 0 To 11
> dt.Rows.Add(dt.NewRow)
> For y As Integer = 0 To dt.Columns.Count - 1
> dt.Rows(i)(y) = y.tostring
> Next
> Next
> ds.Tables.Add(dt)
> ds.WriteXml("C:\scorpion.xml")
> ///
>
> > I have a small problem in writing XML file from VB.net. I am trying to
> write
> > the XML file using dataset.
> > I am able to write the XML in sequential way(one node after other). I
can
> > write in the hierarchial(tree) structure also but only by using
datagrid.
> > But I would like to write the XML file without using datagrid but just
the
> > grid.
> >
> > I am sending the sample. Could u please tell me how I can write
> > hierarchially using dataset but without using the datagrid.
>
>