Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim n As Integer = 0
Dim data() As Item1
For n = 0 To 10
ReDim Preserve data(n)
data(n) = New Item1("item" & n, n * 2)
Next
For Each ss In data
MsgBox(ss.Name & " , " & ss.Code)
Next
Dim aaa = From c As Item1 In data Where ((1 < c.Code) AndAlso (c.Code < 10)) Select c.Name
MsgBox(aaa.Count)
End Sub
Public Class Item1
Private _Name As String
Private _Code As Integer
Sub New(ByVal val1 As String, ByVal val2 As Integer)
Me._Name = val1
Me._Code = val2
End Sub
Public Property Name() As String
Get
Return Me._Name
End Get
Set(ByVal value As String)
Me._Name = value
End Set
End Property
Public Property Code() As Integer
Get
Return Me._Code
End Get
Set(ByVal value As Integer)
Me._Code = value
End Set
End Property
End Class