↧
Reading XML file using LINQ to XML
Hi,Please try to refer to the following code:XDocument objDoc = XDocument.Load(Server.MapPath("XMLFile1.xml")); var data = from item in objDoc.Descendant("appSettings").Descendants("add") select...
View ArticleReading XML file using LINQ to XML
XDocument objDoc = XDocument.Load(@"C:\Sites\stringEx\App.config"); foreach (var el in objDoc.Descendants("appSettings").Descendants("add")) { Console.WriteLine("{0} {1} ", el.Attribute("key").Value,...
View ArticleReading XML file using LINQ to XML
<?xml version="1.0" encoding="utf-8"?><appSettings><add key="a" value="b"/><add key="c" value="d"/></appSettings> How can I read the values of key a and c using Linq to...
View Article