Linq Projection in Vb

This tutorial was created with Microsoft VisualReturn _name
Stuio.NET 2008. 2005 can be used, but you must installEnd Get
Microsoft's LINQ Community Technology PreviewSet(ByVal value As String)
release._name = value
In this tutorial we will look at LINQ Projection, which isEnd Set
when we can select specific data from a sourceEnd Property
without retrieving all fields. We will be creating a classPublic Property City() As String
to define a list in which we will create a number ofGet
people with IDs, names and cities. Then we will useReturn _city
buttons to select only parts of this data.End Get
First, we will start off by creating a new WindowsSet(ByVal value As String)
Form application in VS.NET 2008. Next, we will create_city = value
a class - call it aList - and define our list object:End Set
Public Class aListEnd Property
Private _personID As IntegerEnd Class
Private _name As StringThis class defines a Property for each field we want,
Private _city As Stringand its data type.
Public Property PersonID() As IntegerNext, we can add our Controls to the Form. We will
Getadd three buttons, and a Rich TextBox. The buttons
Return _personIDwill retrieve all of the IDs, Names and Cities, individually.
End GetThis will demonstrates how we can retrieve the
Set(ByVal value As Integer)specific data that we want. Once we have our
_personID = valuecontrols, we can move onto the code-behind of the
End Setform and define our data. We will add a few sample
End Propertyentries:
Public Property Name() As StringPlease to complete this article. Happy Coding!
Get