Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReadXml Method

Status
Not open for further replies.

miket26

Programmer
Apr 13, 2004
63
CA
Hello,

Anyone know how to use the ReadXml method of a Dataset to read an actual String variable instead of a stream to a file. I have XML data stored in a String variable, and would like the Dataset to read the contents of that variable to place into a Datatable. Should I be creating a steream to a string variable, and pass that stream to the ReadXml method? If this is the case, how would I create a streamreader to a String variable? Any help would be greatly appreciated, as I have spent quite a bit of time trying to overcome this problem.

Thanks,

Mike.
 
Try
dsXmlTr = New System.Xml.XmlTextReader _
(New IO.StringReader(sXML))
dsRsp.ReadXml(dsXmlTr, XmlReadMode.IgnoreSchema)
Catch ex As Exception
........
Finally
Try
' Close XMLTextReader and underlying StreamReader
dsXmlTr.Close()
Catch
End Try

End Try

Compare Code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top