xml file contains number of nodes i just want to read last two nodes how do i do that

can you provide a structure for the nodes? do you want embedded nodes or something?

There are a lot of different ways you could do this in LINQ to XML, especially if you return the XML elements as a query that has all of your XElements as an IEnumerable<XElement> set. You could even read in the entire document, query it OrderedBy in reverse, and then just read the top two...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.