Linq to xml in c#

tojkmooehf

New Member
Scenario:[*]Grid view gets populated in WPF window.[*]Having a static list in code behind.(which i want to get from a xml file).Trying to move the static list into an xml file.For that i created a ml file in the following format\[code\]<customers><customer Name="abc"/><customer Name="def"/></customers>\[/code\]CodeBehind:\[code\]Xdocument doc=Xdocument.load("customers.xml");var customerList = (from e in doc.Descendants("Cusomters") select new { CustomerName = e.Attribute("Name").Value }).ToList();\[/code\]I am unable to get the customer names from the xml file to the customerList.I would appreciate if someone can help me to move forward.
 
Top