Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Monday, August 24, 2009

XML and LINQ



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

About Me

My photo
simple and straight forward