Query all Ford cars : Descendants « XML LINQ « VB.Net






Query all Ford cars

  

Module Program

  Sub Main()
    Dim doc As XElement = XElement.Load("Inventory.xml")
    Dim fords = From c In doc.Descendants("Make") _
                Where c.Value = "Ford" _
                Select c

    For Each f In fords
      Console.WriteLine(f)
    Next
  End Sub
End Module

   
    
  








Related examples in the same category

1.Getting Descendants
2.Using Linq to get default in a Office 2007 word document
3.Select all Descendants
4.Select nodes from Descendants