从SharePoint Web服务返回的XML元素z:row中有两个不同的国家属性。
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);
现在我想合并这两个列表,以获取不同的国家名称并加载下拉框。
distinctCountriesList.Add("");
distinctCountriesList.Sort();
country.DataSource = distinctCountriesList.Distinct();
country.DataBind();