Hi @Mansour_Dalir ,
You could refer to the following code.
-
dtParent.AsEnumerable()
converts the DataTable into an enumerable collection. -
Select(Function(row) row. Field(Of String)("B"))
Select the value of column B. -
Distinct()
returns an indistinct value. -
ToArray()
converts the result to an array of strings.
Dim distinctValues As String() = MyDataTable.AsEnumerable().Select(Function(row) row.Field(Of String)("B")).Distinct().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.