I want to convert the datatable columns value into list of elements.
Ps : the output should not contain duplicate values
Example : I have datatable called DT1, containing 2 columns
Needed this to be converted to list elements
Hi @Kavya_Bhat ,
With regards to your question, Not sure i understand as per your expectation. However, as per my understanding goes, you wanted your datatable values to be converted into list but it shouldn’t contain the duplicates. If this is correct,
try the below logic
DT_To_List = DT1.AsEnumerable().Select(Function(r) r("Name").ToString()).Distinct().ToList()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.