Microsoft offers a hands on lab (HOL) which guides you step by step through creation of a application using LINQ. As always, somebody forgot to show the VB code.
Here it is
Imports System.Data.Linq Imports System.Data.Linq.Mapping Module Module1
Sub Main() Dim conn As String = "Data Source=.\sqlexpress;Initial Katalog=Northwind" Dim db As DataContext = New DataContext(conn) Dim customers As Table(Of Customer) = db.GetTable(Of Customer)() db.Log = Console.Out
Dim custs = From c In customers _ Where c.city = "London" _ Select c For Each cust In custs Console.WriteLine("ID={0}, City={1}", cust.CustomerID, cust.City)
Next Console.ReadLine()
End Sub <Table(Name:="Customers")> _
Public Class Customer <Column(IsPrimarykey:=True)> _
Public customerid As String Private _city As String <Column(Storage:="_city")> _
Public Property city() As String Get Return _city End Get Set(ByVal value As String) _city = value
End Set End Property End Class End Module
Link to linq HOL