Unable to bind data to DropDownList

tomraider

New Member
I am binding XML values to a DropDownList. Below is my code:\[code\]protected void LoadDropdown(){ DataSet ds = new DataSet(); ds.ReadXml (Server.MapPath(@"XMLFile1.xml")); DropDownList1.DataTextField = "country_Id"; DropDownList1.DataSource = ds; DropDownList1.DataBind(); DropDownList1.Items.Insert(0,new ListItem(" Select ","0"));} \[/code\]I want to get country names in the DropDownList, but I am getting id values like 0,1,2,3. What am I doing wrong?
 
Back
Top