Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Jumpstart in linq
Message
General information
Forum:
ASP.NET
Category:
LINQ
Environment versions
Environment:
VB 8.0
OS:
Vista
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01523960
Message ID:
01524002
Views:
59
I did put MS SQL as database, so I plead guilty.




>But Marc's question was a Linq to Dataset rather than a Linq to Sql one anyway.....
>
>>I didn't say LINQ was dead. I said LINQ to SQL is dead. Microsoft is putting it's efforts behind Entity Framework for database access. LINQ to Objects and LINQ to XML are alive and well.
>>
>>>Somebody here told me to use Linq rather the traditonial scanning through the traditional ado.net recordset to aggregate information from a database extraction.
>>>
>>>Now I'm puzzled. And I'm working in vb.net btw.
>>>
>>>This seems to work for me btw (osql.execute extracts an access query in a datatable osql.dt).
>>>
>>>
>>> 
>>>        Dim osql As New sqlClass : osql.Execute("qryBestelKK")
>>>        Dim orders As IEnumerable(Of DataRow) = osql.dt.AsEnumerable
>>>
>>>        Dim test = From r In orders _
>>>                   Group r By name = r.Field(Of String)("KL_Naam") _
>>>                   Into g = Group Select New With {.Name = name, .total = g.Sum(Function(r) r.Field(Of Decimal)("Bestd_Waarde"))}
>>>
>>>        For Each r In test
>>>            Console.WriteLine("name: {0} total {1}", r.Name, r.total)
>>>        Next
>>>
>>>
>>>Can't begin to imagine why you would say Linq is dead. It is sooooo straightforward :)
>>>
>>>BTW this is just one of the manipulation I do on that table, but the others are scalars, and they were easier to figure out.
>>>
>>>Thanks for caring.
>>>
>>>>
>>>>
>>>>>Could somebody translate
>>>>>
>>>>>
>>>>>select Kl_Nummer,ArtBtw,sum(bestd_waarde) as netto from [somtable] group by kl_nummer,ArtBtw
>>>>>
>>>>>
>>>>>into linq?
>>>>>
>>>>>Thanks. Just need to see it done once, or refer me to a link (no pun intended)

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform