Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Working with XML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Lozzi - 27 Sep 2007 20:01 GMT
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
sloan - 27 Sep 2007 20:12 GMT
To write xml, look at the XmlWriter

http://www.c-sharpcorner.com/UploadFile/mahesh/writexmlusingXmlWriter11132005233
450PM/writexmlusingXmlWriter.aspx


or google it.

I think it is your "lightest weight" object for writing needs.

If you have an EXISTING xml doc, then you need to use the XmlDocument,
because you'll have to use something like

SelectNodes
SelectSingleNode

to navigate the tree, and find the correct place to insert/update data.

> Howdy,
>
[quoted text clipped - 10 lines]
> Thanks!
> David Lozzi
IfThenElse - 27 Sep 2007 20:14 GMT
If you manipulated data can end in a DataSet then

Dim     YourDataSetThatHasAllTheMinipulatedData     as
System.Data.DataSet

YourDataSetThatHasAllTheMinipulatedData.WriteXml("XMLFile.xml")

This might help you?

> Howdy,
>
[quoted text clipped - 10 lines]
> Thanks!
> David Lozzi
IfThenElse - 27 Sep 2007 20:17 GMT
http://www.aspnettutorials.com/tutorials/database/XML-vb.aspx

> Howdy,
>
[quoted text clipped - 10 lines]
> Thanks!
> David Lozzi
Alexey Smirnov - 27 Sep 2007 20:36 GMT
> Howdy,
>
[quoted text clipped - 10 lines]
> 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();

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.