Loop & concadate data in a DataTable

Hello Community

Could you please help me with the following?

I would like to concatenate a string of values ​​if the company name is the same. As per below:

Current table



Any help you can give me will be greatly appreciated.

Thank you :slight_smile:

We can do a very clever solution using LINQ.

DT.AsEnumerable().GroupBy(Function(row) row("company_name").ToString())

See attached for full example.
DataTableGroupByExample.zip (28.4 KB)


Hi @oddrationale,

Thanks for the help.

I am getting an error when trying to re-use your sequence. Do I need to install a package or import a component?

Thanks again. :slight_smile:


Check below post, we need to add a assembly reference to avoid that error


Mark as solution if this helps you


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.