I am trying to get data from XML file but can\'t get. I don\'t know what I am missing here.
XML File:
Try xml linq
Imports System.Xml
Imports System.Xml.Linq
Module Module1
Const FILENAME As String = "c:\temp\test.xml"
Sub Main()
Dim doc As XDocument = XDocument.Load(FILENAME)
Dim results = doc.Descendants("TestObject").Select(Function(x) New With { _
.site = CType(x.Element("Site"), String), _
.name = CType(x.Element("Name"), String), _
.url = CType(x.Element("URL"), String) _
}).ToList()
End Sub
End Module