Hi @Mansour_Dalir , You can refer to the following code, using GroupBy in linq.
Dim outputArray = MyDataTable.AsEnumerable().
GroupBy(Function(row) row.Field(Of String)("B")).
Select(Function(group) New Tuple(Of String, List(Of Integer))(group.Key, group.Select(Function(row) Integer.Parse(row.Field(Of String)("A"))).ToList())).
ToArray()
Best Regards.
Jiachen Li
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.