How to bind data from an XMLWebService to a DropDownList?
I have this code but it doesn’t work:
Dim xMaster As New MasterService.Masterservice
DT = xMaster.GetDataProgram
DT.Load(DT)
DDL.DataSource = DT
DDL.DataTextField = DT.Columns("cdProgram").ColumnName.ToString()
DDL.DataValueField = DT.Columns("nmProgram").ColumnName.ToString()
DDL.DataBind()
I tried to bind it to the GridView and the values are shown. But, when I tried to bind it to the dropdownlist, it returns nothing. Thank you very much.
Try this: