I have datatable and a list of string (having years) need a select query to fetch those records from datatble that is containing the items from list

Hi @sheetal_Bora ,

Could you give an initial try with the below Linq :

FilterDT = DT.AsEnumerable.Where(Function(x)yourYearList.Any(Function(y)CDate(x("Event Date").ToString).Year.ToString.Equals(y))).CopyToDatatable

Here, FilterDT is a new Datatable, DT is your input Datatable, yourYearList is the list of years in String type. You could change the column name accordingly, assumed it is Event Date.

We also take note that a Direct CopyToDatatable gives an error if there are no filtered rows, hence we follow the post below :

Let us know if there are exceptions found and provide a Screenshot/Exception Message encountered.