April 18, 2006

VB.NET/ASP.NET XML String to Dataset

Ok, I had to post this! This is how you can take an XML string and create a dataset from it. Couldn't find anything on Google so I hope this helps everyone!

strXML = "<your><xml><string>"

Dim XMLreader As StringReader = New System.IO.StringReader(strXML)

' Create the dataset
Dim newDS As DataSet = New DataSet
newDS.ReadXml(XMLreader)


Simple!!




2006-05-19T20:21:38.9490000-07:00
63.105.105.111

kick it on DotNetKicks.com

7 comments:

Alex said...

I don't think it worked...

David Green said...

It seems like it should work, I know I've done this kind of thing before...

My guess is your variable strXML in the example is not well formed XML syntax. If you ran your example, as is, you would no doubt run into weirdness.

Oughtsix said...

Please update your profile with the address your would like me to send your BEER to!

Thank you, works perfectly!

CRPietschmann said...

What about the MSDN article "Loading a DataSet from XML"?
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx

Madchops1 said...

Make sure you import the namespace system.IO to access the StringReader or you may encounter an issue.

- Karl Steltenpohl Develpment
- karls @ karlsteltenpohl.com

stella said...

Replica Handbags
Fake Handbags
Knockoff Handbags

Replica Louis Vuitton Handbags
Replica Gucci Handbags
Replica Chanel Handbags
Prada Handbags
Replica Fendi Handbags
Replica Dolce Gabbana Handbags
Replica Chloe Handbags
Replica Jimmy Choo Handbags
Replica Thomas Wylde Handbags
Replica MiuMiu Handbags

Replica Balenciaga Handbags
Replica Coach Handbags
Replica Lancel Handbags
Replica Hermes Handbags
Replica Marc Jacobs Handbags
Replica Anya Hindmarch Handbags
Replica YSL Handbags
Replica Mulberry Handbags
Replica Givenchy Handbags
Replica Valentino Handbags
Replica Versace Handbags
Replica Cartier Handbags
Replica Marni Handbags
Replica Bottega Veneta Handbags
Replica Loewe Handbags
Replica Kooba Handbags

Replica Bally Handbags
Replica Burberry Handbags
Replica Christian Dior Handbags
Replica Juicy Couture Handbags
Replica Ferragamo Handbags
Replica Celine Handbags

Unknown said...

Its not working.. I have tried. Always dataset values showing "None" values.