sábado, 8 de noviembre de 2014

Select in LinQ

Private Sub btnEjemplo7_Click(sender As Object, e As EventArgs) Handles btnEjemplo7.Click
        ' Consulta en linq que regresa de facturas mayores 2000
        Dim tblinvoices As List(Of Invoice) = InvoiceDB.GetInvoices
        Dim tbllinq = From invoices In tblinvoices
                      Where invoices.InvoiceTotal > 2000
                      Order By invoices.InvoiceDate Descending
                      Select invoices.InvoiceNumber,
                        invoices.InvoiceTotal,
                        invoices.InvoiceDate

        Me.gvEjemplo.DataSource = tbllinq.ToList
    End Sub

No hay comentarios:

Publicar un comentario