I have the following datatable - Let's say called MyTable
:
Col1: Col2: Col3: Col4:
1 abc def <null>
2 abc def ghi
1 abc def <null>
3 abc def <null>
1 abc def <null>
And I'm trying to get the distinct rows:
Col1: Col2: Col3: Col4:
1 abc def <null>
2 abc def ghi
3 abc def <null>
I tried the following LINQ statement:
MyTable = (From dr As DataRow In MyTable Select dr).Distinct.CopyToDataTable
But it's returning the original datatable with the repeated rows back to me.
What am I doing wrong AND how can I get my desired output??