在我的代码中
XmlNode xNode2 = doc2.SelectSingleNode("PageQuery/QueryReport[@id='" + 1 + "']/MainReport/OpenReport");如何选择XmlDataSource中的所有子节点?
发布于 2009-11-12 20:26:09
xNode2.SelectNodes("child::*")怎么样?
发布于 2011-11-29 15:35:54
执行以下操作:
XDocument doc = XDocument.Parse(XmlNode.InnerXml)
var xmlValuesPath = doc.Element(ParentNodeName).Element(ChildNodeName).Attribute(NameOftheTag which holds the Values Inside it);然后,您可以轻松地将其分配给任何控件,如:
lblCompany.Text = doc.Element(ParentNodeName).Element(ChildNodeName).Attribute("Country").Value;https://stackoverflow.com/questions/1437146
复制相似问题