' Visual Basic 2008 9.0 .NET Examples - LINQ - Language Integrated Query - New in Visual Basic 2008 - 9.0 : Public Class Example2 Public Shared Sub Main() Dim persons As Person() = New Person() { _ New Person With {.Name = "John", .City = "New York", .IsMale = True}, _ New Person With {.Name = "Bo", .City = "New York", .IsMale = False}, _ New Person With {.Name = "Jane", .City = "London", .IsMale = False}, _ New Person With {.Name = "Paul", .City = "New York", .IsMale = True}} ' Dim personsNY As IEnumerable(Of Person) = _ From person In persons _ Where person.City = "New York" _ Order By person.Name _ Select person ' For Each person As Person In personsNY Console.WriteLine(person) Next ' Console.ReadLine() End Sub End Class ' Visit www.studyvb.com for more examples. Copyright 2003-2008 De Wolf.