Solved

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

Posted on 2012-04-04
2
289 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get size of each directory on each mapped drive 5 36
SQL LINE CONTINUATION ISSUE 12 37
Footer for each row on Gridview 2 33
VB.net Progress Bar - Maximum Value too large 2 15
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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