Working with XML

D

David Lozzi

Howdy,

I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
Basically, i am collecting a ton of info from SQL, from various
Tables/Views/Procs, adding some data on the fly then I need to output the
entire thing to XML. I know i can create a string object and simply create
an XML string but that's messy. I know there's a XMLDocument object but I
can't seem to get it to work. Ideally, i'd like to have an XML object of
some sort and then work through it's elements/nodes and populate the
information as needed. If you could provide some sample script that'd be
great.

Thanks!
David Lozzi
 
I

IfThenElse

If you manipulated data can end in a DataSet then

Dim YourDataSetThatHasAllTheMinipulatedData as
System.Data.DataSet

YourDataSetThatHasAllTheMinipulatedData.WriteXml("XMLFile.xml")

This might help you?
 
A

Alexey Smirnov

Howdy,

I'm using VB.Net 2.0. Is there an easy object to use to handle XML?
Basically, i am collecting a ton of info from SQL, from various
Tables/Views/Procs, adding some data on the fly then I need to output the
entire thing to XML. I know i can create a string object and simply create
an XML string but that's messy. I know there's a XMLDocument object but I
can't seem to get it to work. Ideally, i'd like to have an XML object of
some sort and then work through it's elements/nodes and populate the
information as needed. If you could provide some sample script that'd be
great.

Thanks!
David Lozzi

e.g. XmlTextWriter

StringWriter sw = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(sw);
writer.WriteStartElement("...");
writer.WriteEndElement();
writer.Flush();
writer.Close();
sw.Close();
 

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