Not Able to get Attribute having specific element from XML file, using LINQ

Hey @sahilbaglat
you can try use:
(From el In xDOC.Descendants("Batch") Where el.Element("BatchID") IsNot Nothing AndAlso el.Element("BatchID").Value.Equals(str_Batch) Select el.Attribute("ProductionDate")).ToList()


image

List<XAttribute>(1) { [ProductionDate="2024-01-23"] }

3 Likes