How can we get the division from data table that is US and Canda along with their file names only once
After that we have to use for each activity (Only Once for each division)
Does that mean we need to get the first entry of each division? Because here in the table the rows are not duplicate and what should be the criteria for selecting the row?
@anmita Please check this one I have written for you.
For your case, I used a collection to store the Division. Then I loop through the data table and if the division name is not in the collection, I add that division name into the collection else, I remove the data row from the input data table. In the end, you will get only the first occurrence of each division. I hope it solves your problem.
(From d In DtBuild.AsEnumerable
Group d By k2=d(2).toString.Trim Into grp = Group
Let ra = New Object(){grp.First()(0),grp.First()(1),k2,grp.First()(3),grp.First()(4)}
Select r = DtClone.Rows.Add(ra)).CopyToDataTable