I need to split datatable into two datatables based on Group by and another column values.
From the Source Datatable, I need to move records based on Group by columns “Col 1” and “Col 2”. In addition, if the values in the “Col 3” contains “I” & “A”, then the set of records should be moved to new datatable (DT1). And rest of the Source Datatable should be moved to another new datatable (DT2). Please help me to solve this.
What I have:
What I need:
In a New Datatable (DT1):
In a New Datatable (DT2):
Since dealing with datatable with large data, I am trying in LinQ Query instead of For Each loop:
Please help me