locked
Wouldl ike to populate dropdownlist with countries GeoNames .NET WCF Client datatable RRS feed

  • Question

  • User-1164658185 posted
    Wouldl ike to populate dropdownlist with countries GeoNames .NET WCF Client datatable?
    Need help on 
    public void LoadCountries()
            {
                using (GeoNamesClient client = new GeoNamesClient())
                {
                  
                    var response = client.GetCountries("it", GeoStyle.Full);
                    
                    DataTable dt = new DataTable();
    
    
                    _ddlCountry.DataTextField = response.countries.
                    _ddlCountry.DataValueField = "CountryCode";
                    _ddlCountry.DataSource = dt;
                    _ddlCountry.DataBind();
    
                    // Insert the first item.
                    _ddlCountry.Items.Insert(0, new RadComboBoxItem("- Select your country -"));
    
                }
            }

    Sunday, May 5, 2013 1:27 AM

Answers