Autor Beitrag
kostonstyle
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 94



BeitragVerfasst: Di 26.07.11 09:49 
Hallo miteinander
habe eine Frage zu LINQ to XML, wie filtere ich hier nur der Wert des Attribut heraus,
also ich möchte die Werte New York, Chicago und San Diego haben, die untergeordnete Elemente
interessieren mich nicht.

ausblenden XML-Daten
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
<city_inventory>
  <city name="New York">
    <nas>Nas1</nas>
    <folder>Folder1</folder>
  </city>
  <city name="Chicago">
    <nas>Nas2</nas>
    <folder>Folder1</folder>
  </city>
  <city name="San Diego">
    <nas>Nas2</nas>
    <folder>Folder1</folder>
  </city>
</city_inventory>

Gruss kostonstyle
dark-destination1988
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 178
Erhaltene Danke: 21



BeitragVerfasst: Di 26.07.11 10:09 
ausblenden C#-Quelltext
1:
var selected=from city in city_inventory where city.Name=="New York"||city.Name=="Chicago"||city.Name=="San Diego" select city.Name;					


Moderiert von user profile iconTh69: C#-Tags hinzugefügt
kostonstyle Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 94



BeitragVerfasst: Di 26.07.11 10:34 
vielen vielen dank....