Sum group by Code and Dept

Hi all,
I compare dtSCN001 vs dtDeposit2 by column0 (Code) to filter Code .

(From d1 In  dtSCN001.AsEnumerable
Let chk =  dtDeposit2.AsEnumerable.Any(Function (d2) d2(0).toString.Equals(d1(0).toString.Trim))
Where chk
Select r=d1).CopyToDataTable

Then use Each Loop to Sum group by Code(A) and Dept(C) but not correct. Can I use linq for this step or can be grouped into 1 code


Thank all

looks more like a group by and group member aggregation

NON LINQ - DataTableVar.DefaultView.ToTable(…, Loop, Filter, Aggregation
LINQ: From d in DataTableVar.AsEnumerable Group d …