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!!
6 comments:
I don't think it worked...
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.
Please update your profile with the address your would like me to send your BEER to!
Thank you, works perfectly!
What about the MSDN article "Loading a DataSet from XML"?
http://msdn2.microsoft.com/en-us/library/fx29c3yd.aspx
Make sure you import the namespace system.IO to access the StringReader or you may encounter an issue.
- Karl Steltenpohl Develpment
- karls @ karlsteltenpohl.com
Its not working.. I have tried. Always dataset values showing "None" values.
Post a Comment