| This tutorial was created with Microsoft Visual | | | | Return _name |
| Stuio.NET 2008. 2005 can be used, but you must install | | | | End Get |
| Microsoft's LINQ Community Technology Preview | | | | Set(ByVal value As String) |
| release. | | | | _name = value |
| In this tutorial we will look at LINQ Projection, which is | | | | End Set |
| when we can select specific data from a source | | | | End Property |
| without retrieving all fields. We will be creating a class | | | | Public Property City() As String |
| to define a list in which we will create a number of | | | | Get |
| people with IDs, names and cities. Then we will use | | | | Return _city |
| buttons to select only parts of this data. | | | | End Get |
| First, we will start off by creating a new Windows | | | | Set(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 aList | | | | End Property |
| Private _personID As Integer | | | | End Class |
| Private _name As String | | | | This class defines a Property for each field we want, |
| Private _city As String | | | | and its data type. |
| Public Property PersonID() As Integer | | | | Next, we can add our Controls to the Form. We will |
| Get | | | | add three buttons, and a Rich TextBox. The buttons |
| Return _personID | | | | will retrieve all of the IDs, Names and Cities, individually. |
| End Get | | | | This will demonstrates how we can retrieve the |
| Set(ByVal value As Integer) | | | | specific data that we want. Once we have our |
| _personID = value | | | | controls, we can move onto the code-behind of the |
| End Set | | | | form and define our data. We will add a few sample |
| End Property | | | | entries: |
| Public Property Name() As String | | | | Please to complete this article. Happy Coding! |
| Get | | | | |