Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Linq Syntax
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Titre:
Linq Syntax
Versions des environnements
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
Jet/Access Engine
Application:
Desktop
Divers
Thread ID:
01524641
Message ID:
01524641
Vues:
95
Can this be done in one statement, i.o.w how do I define an Order By clause with a select Group Select New construction?
        Dim orders As IEnumerable(Of DataRow) = osql.dt.AsEnumerable
        Dim Test2 = From r In orders _
            Group r By nummer = r.Field(Of String)("KL_Nummer"), name = r.Field(Of String)("KL_Naam"), artBtw = r.Field(Of Double)("ArtBtw") _
            Into g = Group Select New With {.Nummer = nummer, .Name = name, .artbtw = artBtw, .total = g.Sum(Function(r) _
                r.Field(Of Decimal)("Bestd_Waarde") * (1.0 - CDbl(If(r("art_korting") = False, 0.0, If(r("kkkorting") Is DBNull.Value, CDbl(r("KLkorting")), CDbl(r("KKKorting")))))))}
        Dim test = From r In Test2 Order By r.Name

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform