Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

Can anyone help me with a LINQ query.

I have the following

Dim query From transaction in _SourceDataTable
Group transaction By
account = transaction.item("Account")
Into BuyAmount = Sum(Convert.ToDouble(transaction.item("Buy"))), _
SellAmount = Sum(Convert.ToDouble(transaction.item("Sell)))
Select account, BuyAmount, SellAmount

This works fine to bring me back the total for each account, however, i just want the total BuyAmount and SellAmount for the whole Data Table, however, cant seem to get an Into statement without the Group By.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900