I have a LINQ query for my XML file and it looks like this:
IEnumerable<XElement> c = from cli in xEl.Elements(ns + "client") where cli.Element(ns+"ID").Value == (((Client)cComboBox.SelectedItem).Id +"") select cli;
It works fine .. Then I want to repeat this data, so I do it
foreach (XElement el in c) { }
my xml file is as follows
<client> <ID>1</ID> <name>Andrej</name>
through this iteration I want to extract client values (id → 1 , name → Andrej )
My guess was to put el.Element("name").Value in the middle of the loop, but this does not work ... oh and btw: I am doing this in C # ..
What should I do?
btw2: as you can see, I am new to linq, so I think I left this track ...
Any help would be assigned !! TNX!
source share