Hello
I have a datatable: dt_OutputTable3 with one column like this:
Company
ABCD
ABCD
ABBB
ABCE
ABCE
EEEE
Now i build another datatable dt_OutputTable2 with two columns: Company (String) and Count (INT)
I would like a table with the individual companies and how often they occur.
I use assign activity:
dt_OutputTable2 =
(From row In dt_OutputTable3.AsEnumerable()
Group row By Unternehmen = row.Field(Of String)(“Unternehmen”) Into Group
Select dt_OutputTable2.Rows.Add(Unternehmen, Convert.ToString(Group.Count()))).CopyToDataTable()
With this i keep getting the following error message:
Assign: Unable to cast object of type ‘System.Int32’ to type ‘System.String’.
dt_OutputTable2 should look like this at the end:
Company Count
ABCD 2
ABBB 1
ABCE 2
EEEE 1
Can someone help me?
Thanks a lot!!