i need to get the value of an Node in an XML File.
My XML file looks like this:
You can use Linq To Xml.
Assuming you you have other products like IPHONE
under PRODUCTS
var products = XDocument.Load(filename).Root
.Elements()
.Select(x => new
{
Product = x.Name.LocalName,
Name = (string)x.Element("NAME"),
Model = (string)x.Element("MODEL"),
Price = (decimal)x.Element("PRICE"),
Color = (string)x.Element("COLOR")
})
.ToList();