private void ButtonRequest_Click(object sender, EventArgs e)
{
XmlDocument xml = new XmlDocument();
XmlDocument request = new XmlDocument();
XmlDocument fil = new XmlDocument();
request = xmlRequest1();
fil = xmlFilter();
response = doAvail(request, fil);
XElement po = XElement.Parse(response.OuterXml);
IEnumerable<XElement> childElements = from el in po.Elements() select el;
foreach (XElement el in childElements)
{
ListViewItem item = new ListViewItem(new string[]
{
el.Descendants("Name").FirstOrDefault().Value,
el.Descendants("PCC").FirstOrDefault().Value,
el.Descendants("BusinessTitle").FirstOrDefault().Value,
});
ListViewResult.Items.Add(item);
}
}
当我循环到liesviewitem 时出现错误。请协助,谢谢。