Hi  Juan

Try this code..........and enjoy


> Partial Public Class _Default
>     Inherits System.Web.UI.Page
>
>     Protected Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Me.Load
>
>         Dim crs As New Cars
>         crs.Add(New Car() With {.Color = "Rojo"})
>         crs.Add(New Car() With {.Color = "Verde"})
>         crs.Add(New Car() With {.Color = "Rojo"})
>         crs.Add(New Car() With {.Color = "Azul"})
>
>         Dim otrocarros As List(Of Car)
>         otrocarros = (From c In crs Where c.Color.StartsWith("R") Select
> c).ToList()
>         For Each oc In otrocarros
>             Response.Write(oc.Color.ToString)
>         Next
>
>     End Sub
>
> End Class
>
> Public Class Cars
>     Inherits List(Of Car)
>
> End Class
>
> Public Class Car
>
>     Private _color As String
>     Public Property Color() As String
>         Get
>             Return _color
>         End Get
>         Set(ByVal value As String)
>             _color = value
>         End Set
>     End Property
>
> End Class
>
>
> Thanks!!!!
>

Reply via email to