I have a datatable below that i receive from an API call, the section of this datatable is field From and To. I want to remove the rows where the From and To are the same.
E.g. PRIMARY.personalDetails.forename,Heldmann,heldmann - From: Heldmann and To: heldmann are the same it’s just case different i’d like to remove this and any other row that may have the same values
distinctRows= (From row In YourDataTable.AsEnumerable()
Where Not String.Equals(row.Field(Of String)("From"), row.Field(Of String)("To"), StringComparison.OrdinalIgnoreCase)
Select row).CopyToDataTable()
distinctRows is of DataType System.Data.DataTable Output: