LINQ-TO-XML not returning all value

Posted by mmcglynn on Stack Overflow See other posts from Stack Overflow or by mmcglynn
Published on 2010-03-08T19:31:34Z Indexed on 2010/03/08 19:36 UTC
Read the original article Hit count: 253

Filed under:
|

I am trying to get all values in the select. using item.Count shows the correct number of values, but only one .Value is returned from the loop. Why?

Dim fooXML As XDocument = XDocument.Load(Server.MapPath("xml/foo.xml"))

Dim query = _
From c In fooXML...<foobaryear> _
Select c...<event>

For Each item In query
    Response.Write(item.Value)
Next

© Stack Overflow or respective owner

Related posts about linq-to-xml

Related posts about vb.net