| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Getting Started with LINQ

Page history last edited by PBworks 16 years ago

CET 4429 Lectures 

 Getting Started with LINQ

 

The intention of this lecture is to get you started with the ability to use LINQ. The class is not designed to make you an expert VB or C# programmer, but the ability to use languages to access and use data is paramount. This lecture will show how you can quickly and easily get started and do some really cool stuff, fast.

 

Pre-requisites:

 Visual Studio 2008 - with .NET 3.5

 

Video

For those who plan to work with LINQ check out the Microsoft How-to Video Lectures Series for LINQpage link )

 

 

 

 

Download Link

 

Source Code

 

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim db As New DataClassesDataContext

        Dim qr = From dbcRow In db.DBConnections Select id = dbcRow.DBConnectionID, name = dbcRow.DBConnectionName

        DropDownList1.DataSource = qr
        DropDownList1.DataTextField = "name"
        DropDownList1.DataValueField = "id"
        DropDownList1.DataBind()

    End Sub

    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
        Dim db As New DataClassesDataContext

        Dim i As Long = DropDownList1.SelectedValue

        gridview1.DataSource = db.spGetDBConnection(i).ToList
        gridview1.DataBind()

    End Sub
End Class

Comments (0)

You don't have permission to comment on this page.