I have a xml file which is given to me by client so i can't change it it looks like this:
CodeBase.XML
<?xml version="1.0" encoding="utf-8"?>
<CATALOG>
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<orderByTitleDesc />
<CD>
<CodeBase>hellow</CodeBase>
</CD>
<CD>
<CodeBase>http://KL1225K7/EViewer/Client/EvCtrl6En.cab#version=9,4,2,9</CodeBase>
</CD>
<CD>
<CodeBase>31 amrch testing for font</CodeBase>
</CD>
<CD>
<CodeBase>CodeBase2</CodeBase>
</CD>
<CD>
<CodeBase>Ser</CodeBase>
</CD>
<CD>
<CodeBase>ZaidiTest</CodeBase>
</CD>
<CD>
<CodeBase>test222</CodeBase>
</CD>
</CATALOG>
I want to bind this xml with this in ddl
I am writing the code in code behind file as follows:
protected void Page_Load(object sender, EventArgs e)
{
string filePath = Server.MapPath("CodeBase.xml");
using (DataSet ds = new DataSet())
{
ds.ReadXml(filePath);
ddlCodeBase.DataSource = ds.Tables["1"];
ddlCodeBase.DataTextField = "CodeBase";
ddlCodeBase.DataValueField = "CD";
ddlCodeBase.DataBind();
}
}
Client side code as Follows:
<asp:DropDownList ID="ddlCodeBase" runat="server" ></asp:DropDownList>
But i am getting empty DDl (No data in it). Please Let me know Guys what to do. Thanks in Advance.