我有一个具有以下数据库结果的数据表
ID Name Class FeeName Amount
9 gumman hgjgh 6Th Fine 0
9 gumman hgjgh 6Th Tution Fee 3000
9 gumman hgjgh 6Th Lebority Fee 500
10 AAdil Hussain 5Th Fine 0
10 AAdil Hussain 5Th Tution Fee 3000
10 AAdil Hussain 5Th Lebority Fee 500
我想根据每个 ID 总结金额,所以我实现以下代码
Dim TotalAmount As New DataColumn("TotalAmount", GetType(Double), "Sum(Amount)")
Dtable.Columns.Add(TotalAmount)
但结果如下
ID Name Class FeeName Amount TotalAmount
9 gumman hgjgh 6Th Fine 0 7000
9 gumman hgjgh 6Th Tution Fee 3000 7000
9 gumman hgjgh 6Th Lebority Fee 500 7000
10 AAdil Hussain 5Th Fine 0 7000
10 AAdil Hussain 5Th Tution Fee 3000 7000
10 AAdil Hussain 5Th Lebority Fee 500 7000
但我想根据每个名称或 ID 总结金额,我不知道 LINQ