I want to load the content of an xml file to a DataTable. I created a Class named News that contains the following function.
Public Shared Function listOfEmployees() As DataTable
Dim dt As New DataTable
Dim xmlPath As String = System.Web.HttpContext.Current.Request.MapPath("~/App_Data/News.xml")
Dim xmlSchema As String = System.Web.HttpContext.Current.Request.MapPath("~/App_Data/schemas/News.xsd")
dt = New DataTable()
dt.ReadXmlSchema(xmlSchema)
dt.ReadXml(xmlPath)
Return dt
End Function
And I get the following Error:
DataTable does not support schema inference from Xml.
I want to call the the function from an Object Data Source and connected to a GridView.
My XML file looks as follow:
<?xml version="1.0" encoding="utf-8" ?>
<news>
<newsItem>
<id>01</id>
<visible>true</visible>
&
View Complete Post