foreach (XmlNode item in xmlnode) { if (strArr.Contains(item.Attributes.GetNamedItem(MspecAttribute).Value))//search the XML with the values in the array { //add the XML values to the datatable dt.Rows.Add(item.Attributes.GetNamedItem(MspecAttribute).Value, item.Attributes.GetNamedItem(XmlNameAttribute).Value); } }
XElement x = XElement.Load(@"Items.xml"); string strCompare = "Test"; var element = from XMLelement in x.Elements("Item") where (string) XMLelement.Attribute("Value")==strCompare select XMLelement;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)