私はデータベースから次の結果を持つDatatableを持っています
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
しかし、LINQのことを知らない各名前またはIDに対して金額を合計したい