Hello sir,
I host in asphostportal
I have access to an XML API in the form of a URL link, so I am trying to display the data on the browser,
to start with, so to make sure the data is returned, but I keep getting the following error:
(name is neither a DataColumn nor a DataRelation for table result.).
It seems there is a problem with the node structure? Below is the ASPNET page and also the xml file
sub Page_Load
if Not Page.IsPostBack then
dim myproducts=New DataSet
myproducts.ReadXml("urlxml")
products.DataSource=myproducts
products.DataBind()
end if
end sub
</script>
<html>
<body>
<form runat="server">
<asp:Repeater id="products" runat="server">
<HeaderTemplate>
<table border="1" width="100%">
<tr>
<th>name</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<div>City: <%#Container.DataItem("name")%></div>
</ItemTemplate>
Below is the extract of the XML from the API URL
<result xmlns="urn:com:example
f:model:xml
utput" xmlns:ns2="urn:com:tradedoubler
f:model:xml:common" version="3.0">
<productHeader>...</productHeader>
<products>
<product language="en">...</product>
<product language="en">
<ns2:name>Pisa Holidays</ns2:name>
<ns2:description>Pisa Holidays</ns2:description>
<ns2
roductImage>
urljpg
</ns2
roductImage>
<ns2:categories>
Please help me to solve this problem
I host in asphostportal
I have access to an XML API in the form of a URL link, so I am trying to display the data on the browser,
to start with, so to make sure the data is returned, but I keep getting the following error:
(name is neither a DataColumn nor a DataRelation for table result.).
It seems there is a problem with the node structure? Below is the ASPNET page and also the xml file
sub Page_Load
if Not Page.IsPostBack then
dim myproducts=New DataSet
myproducts.ReadXml("urlxml")
products.DataSource=myproducts
products.DataBind()
end if
end sub
</script>
<html>
<body>
<form runat="server">
<asp:Repeater id="products" runat="server">
<HeaderTemplate>
<table border="1" width="100%">
<tr>
<th>name</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<div>City: <%#Container.DataItem("name")%></div>
</ItemTemplate>
Below is the extract of the XML from the API URL
<result xmlns="urn:com:example
<productHeader>...</productHeader>
<products>
<product language="en">...</product>
<product language="en">
<ns2:name>Pisa Holidays</ns2:name>
<ns2:description>Pisa Holidays</ns2:description>
<ns2
urljpg
</ns2
<ns2:categories>
Please help me to solve this problem