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

Writing XML file

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
Nov 20 '05 #1
3 1070
Cor
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.

Nov 20 '05 #2
* "Kelly G." <no*@moreply.com> scripsit:
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.


Did you have a look at the classes in the 'System.Xml' namespace, for
example 'XmlDocument'?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Thanks Cor, You've been great help!!
"Cor" <no*@non.com> wrote in message
news:Or**************@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.


Nov 20 '05 #4

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

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
3
by: Barry Flynn | last post by:
Hi I am working with a VB 2005 program which has been converted from VB6. It writes data out to a flat file, with code like the following line WriteLine(riFileNo, "Hist", lsAssetID,...
2
by: alieseraj | last post by:
Hi, I need to extract the images (attached) of a .EML file. Any help or ideas? Thanks in advance.
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.