Say I have a String of XML text or really any text.
How can I write that to a Stream so I can pass that into a DataSet.Read method?
Printable View
Say I have a String of XML text or really any text.
How can I write that to a Stream so I can pass that into a DataSet.Read method?
"I have a String of XML text or really any text."
There I said it are you happy?
Ok, ok I'll give a real answer.
VB Code:
Dim xml As String = "<root><item name=""Ed"" id=""1""/></root>" Dim sw As New IO.StreamWriter(New IO.MemoryStream) 'write to stream sw.Write(xml) 'flush sw.Flush() 'move to start of stream sw.BaseStream.Position = 0 Dim ds As New DataSet ds.ReadXml(sw.BaseStream) DataGrid1.DataSource = ds
Who said good comments are hard to find! :D :thumb:Quote:
Originally posted by Edneeis
VB Code:
.... 'flush sw.Flush() ....
:bigyello: Originally I had a comment related to toliets along with that but ended up giving it the old backspace.