Converting .Net DataTable to an XML String

by demtron on Saturday, February 28, 2009 05:19 PM

Here is a snippet of code that will convert a VB.Net DataTable into a string of XML.

Dim SB As New StringBuilder
Dim SW As New IO.StringWriter(SB)
Items.WriteXml(SW, Data.XmlWriteMode.WriteSchema)

This code writes the contents and schema of the DataTable in to a StringBuilder by way of a StringWriter object.


Comments

5/6/2009 5:30:47 AM #

Xml strings are easier to work with.

Costa

Comments are closed

Powered by BlogEngine.NET 1.5.1.18
Theme by Mads Kristensen · Adapted by Demtron

Bookmark and Share

Calendar

<<  December 2014  >>
MoTuWeThFrSaSu
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar
Log in

Milwaukee SEO Company

Milwaukee Access Programmer/Developer

Milwaukee Website Designer and Developer



Marketing / SEO

Blog Directory
blogarama - the blog directory
TopOfBlogs
Milwaukee area SEO, SEM, ASP.Net