[Solved] Loop through xml [closed]


You have to have a eMail class. (you can change the name in the code sample) it should work.

XDocument xdoc = new XDocument();
xdoc = XDocument.Load(fileName);
var songlist = from c in xdoc.Element("Result").Elements("email")
                           select new eMail{ 
                               ID = c.Element("ID").Value, 
                               Subject = c.Element("Subject").Value };

solved Loop through xml [closed]