do one thing I guess your datatable is having more columns
so create a new datatable with 3 columns and datatype string using build datatable (newdt)
and then change this in the code
- coun = grp.Count.ToString
- s = grp.sum(function(x) x(“column”).ToString).ToString
- Select r = newdt.Rows.add(ra)).CopyToDatatable()
We are changing this because to write to same table the table already you have is having more columns than required(3).so we are creating a new datatable with 3 columns and adding data to that
cheers