Compare 2 columns in a single excel sheet

Hi @soundarya.a ,

Just a slight modification over @Sanjit_Pal 's code:

dt.AsEnumerable().Where(Function(w) CDate(w(0).ToString).Equals(CDate(w(1).ToString))).ToList()

We will convert it to a List of DataRows before copying it to a Datatable because if the operation returns null values i.e., none match the criteria, then the .CopyToDatatable() will throw an error.

Its best to check if it generates any results before going ahead and adding it to a Datatable.
Similarly:

dt.AsEnumerable().Where(Function(w) Not CDate(w(0).ToString).Equals(CDate(w(1).ToString))).ToList()

Kind Regards,
Ashwin A.K