Iterate through columns in a datatable

LINQ_Query.zip (142.4 KB)
You can use LINQ query to get the output using just one ‘assign’ activity.

dt_Output = (From row In dt_Input.AsEnumerable() Group row By acc = row(“debit_acc”).ToString() Into grp = Group Select dt_Input.Rows.Add(acc, grp.Sum(Function(x) Convert.ToDouble(x(“debit_amount”))))).CopyToDataTable()

Please find the attached.