'______________________________________________________________ ' G E T T I N G T O K N O W L I N Q Step 1 ' ' C# VERSION ' Ron Kessler ' 2/5/09 ' ' ' _____________________________________________________________ Imports System.Linq Partial Class _Default Inherits System.Web.UI.Page Dim dc As New AdventureworksDataContext Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load '---now create a LINQ query string. Notice the use a var which creates ' an anyonymous type. The eachproduct is a variable I created & is ' created on the fly. Also, no type is defined! Category 18 has a bunch of data so I chose that. Dim products = From eachproduct In dc.Products _ Where (eachproduct.ProductCategoryID = 18) _ Select eachproduct '---now link up the grid to display our data GridView1.DataSource = products GridView1.DataBind() 'make it so! End Sub End Class