LINQ query to separate rows based on Col name

LINQ query to separate rows based on duplicated Column value into other datatable.
As in screenshot, its MainDt. After seperating Dt1 should have row3 and Dt2 should have row2&4

There are many forum posts about LINQ

Follow this pls

Or use “Filter Data Table” activity - it was created to ease life of “citizen programmers”


Hi @TrinadhB ,

It seems to be a Group By Case on the Description column. Do you want to Identify the Duplicates based on the Description Column ?

We can suggest you the solution approach if you could provide us more accurate details on the requirement.

Identify any duplicate in description column and then separate those rows

hi @supermanPunch
Yes, based on Description column

Lets assume to split into different datatables:

Assign Activity:
TableList | List (Of DataTable) =

(From d in YourDTVar.AsEnumerable()
Group d by k=d("Description").toString.ToUpper.Trim into grp = Group
Select t = grp.CopyToDataTable).ToList

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