Solved

vb.net - how do I use the xmlreader.create with a string rather than a file

Posted on 2012-04-04
2
288 Views
Last Modified: 2012-04-04
I have a string that contains a xml file and want to read this with xml reader - the xmlreader.create command seems to want a file path?
If there a way to read the string into the xmlreader?.
0
Comment
Question by:donhannam
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 37809121
Try:

Dim xml As String = "<root><somechild><somegrandchild></somegrandchild></somechild></root>"
Dim sReader As New System.IO.StringReader(xml)
Dim xReader As System.Xml.XmlReader = System.Xml.XmlReader.Create(sReader)

Open in new window

0
 

Author Closing Comment

by:donhannam
ID: 37809390
Thanks that was what I as after
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now