How to query in C# using LINQ
XDocument xmlFile = XDocument.Load(filename);
var xt = from y in xmlFile.Descendants("Users").Elements("details")
where y.Attribute("userName").Value == x
select new TempClass
{
Name = y.Element("userdetails").Attribute("userFirstName").Value
};
Download Sample Code Here
No comments:
Post a Comment