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 306 | Next

Scott Klein

"Professional LINQ"

..(1).Value
The returned result would be Chris. The extension indexer is zero-based so had you passed a value of 0
to this property, it would have returned Scott.
You can also access XML using embedded queries, which you learned about earlier in the chapter. In the
example that follows, an XML literal is defined with three names. A second XML literal is then created,
using an embedded query to access the names from the first XML literal. The results of the second XML
literal are displayed in the text box.
Dim employee As XElement = _

Scott
Chris
Bill

Dim nameTypes As XElement = _

<%= From name In employee. _
Select <%= name.Value %> _
%>

Me.TextBox1.Text = nameTypes.ToString
187
Part II: LINQ to XML
Here are the results when this code is executed:

Scott
Chris
Bill
The next example builds on the previous example by including an attribute on each element in
the first XML literal.


Pages:
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6