I have 2 separate country attributes in the XML element z:row, returned from SharePoint web services.
var homeCountry = (from xml in doc.Descendants(z + "row") select xml.Attribute("ows_Country").Value).Distinct();
var covCountry = (from xml in doc.Descendants(z + "row")
where xml.Attribute("ows_Coverage_x0020_Area_x0020_by_x00").Value != ""
select xml.Attribute("ows_Coverage_x0020_Area_x0020_by_x00").Value);
Now I want to merge both of the lists, in order to get the distinct country names and load the dropdow dox.
distinctCountriesList.Add("");
distinctCountriesList.Sort();
country.DataSource = distinctCountriesList.Distinct();
country.DataBind();
var distinctCountriesList = homeCountry.Union(covCountry).ToList();
country.DataSource = homeCountry
.Union(convCountry)
.ToList();
country.DataBind();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With