ppr
(Peter Preuss)
October 20, 2023, 9:07pm
8
A more unusual approach, but also working one could be the Group By Approach
Assign Activity
dtMerge = datatable1 .Copy()
Merge DataTable Activity| Merge datatable2 to dtMerge
Assign Activity
dtUniqueRows | DataType: DataTable =
(From d in dtMerge.AsEnumerable()
Group d by k1=d("Column1").ToString.Trim,k2=d("Column2").ToString.Trim,k3=d("Column3").ToString.Trim into grp=Group
Where grp.Count = 1
Select r = grp.First()).CopyToDataTable
Handling empty result we can do:
This FirstAid Tutorial will describe how a the source contains no DataRows EXCEPTION can be handled.
Introduction
Let’s have a look at the following filter data table scenario:
Name
CCode
Tom
US
Charlotte
FR
Seema
IN
Jean
FR
Assignment:
Filter all rows on a particular Country Code like FR, UK, ES, UK…
Ensure that all CCode data column values are trimmed
Ensure that the Filter check is case insensitive
we can implement it e.g. with the help of a LINQ statement:
dtData.As…