SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 230 | Next

Scott Klein

"Professional LINQ"

Items.Add(name);
This code returns the following values:
Joe
Scott
Steve
The following example does the same thing:
IEnumerable empNames =
from emp in employees.Descendants("Name")
orderby (string) emp
select (string) emp;
The same iteration applies, and the results are the same. You can also ??????walk the tree??™??™ by using the
Elements() method (as many times as needed) to access the appropriate node.
IEnumerable empNames =
from emp in employees.Elements("Employee").Elements("Name")
orderby (string) emp
select (string) emp;
Again, the same iteration applies, and the same results are returned.
The next few examples work with attributes, and to do so, the XML document Employee.xml created
earlier needs to be modified. Add an attribute to each employee node as highlighted in following XML:


Scott

555 Main St.
Wellington
FL

All Things Techy
02/05/2007
M


Steve

444 Main St.


Pages:
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6