Gautam Gautam - 5 months ago 35 Question

What is the best way to read an XML file from Embedded resources?

Dim xmldoc As New XmlDocument()
Dim xmlnode As XmlNodeList
Dim i As Integer
Dim str As String


This throws

An exception of type 'System.Xml.XmlException' occurred in System.Xml.dll but was not handled in user code. Additional information: Data at the root level is invalid. Line 1, position 1.


I would normally do this

Dim fsXML As New FileStream("countyByRegion.xml", FileMode.Open, FileAccess.Read)

And then use xmldoc.Load(fsXML)