Hi Experts,
I need to bind a basc XML file to a GridView. I can read the XML into a ds, but when I bind nothing shows up... I also tried the dataview approach as listed in a couple of other questions. I'm sure I'm all over it, but stuck again. The XML and Code are below. Thanks for the help.
'-- The XML File --------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
--------
<?xml version="1.0" standalone="yes"?>
<Links xmlns="links">
<xs:schema id="Links" targetNamespace="links" xmlns:mstns="links" xmlns="links" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-
microsoft-
com:xml-ms
data" attributeFormDefault="qual
ified" elementFormDefault="qualif
ied">
<xs:element name="Links" msdata:IsDataSet="true" msdata:UseCurrentLocale="t
rue">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="link">
<xs:complexType>
<xs:attribute name="text" form="unqualified" type="xs:string" />
<xs:attribute name="url" form="unqualified" type="xs:string" />
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<link text="Report 1" url="~/Customer Data/File 1.xls" />
<link text="Report 2" url="~/Customer Data/File 1.xls" />
<link text="Report 3" url="~/Customer Data/File 1.xls" />
<link text="Report 4" url="~/Customer Data/File 1.xls" />
</Links>
'-- CODE ( one of my attempts anyway ) --------------------------
----------
----------
----------
----------
----------
----------
----------
----------
---
Dim ds = New DataSet
ds.ReadXml(Server.MapPath(
"~\App_Dat
a\XMLCusto
merReports
List.xml")
, XmlReadMode.ReadSchema)
gridCustReports.DataSource
= ds.Tables("link").DefaultV
iew
gridCustReports.DataMember
= "link"
Page.DataBind()
'-------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----
Thanks Again !