I need your help. I have the data in excel file and uploaded into a data table (DT_ThFX). Now I have taken 2 inputs from users and storing them into 2 string variables In_StartDate and In_EndDateNow. I am getting the input from the user like 01 Jul 2021 (In_StartDate) and 30 Sep 2021 (In_EndDate)
I am trying to apply filter on my data table and want to copy to another datatable. The column name where I am applying filter is “Trade Date”. I have written the below query but I am getting the below error
DT_ThFX.Select.Where(Function(x) DateTime.Parse(x(“Trade Date”).ToString)>= DateTime.Parse( In_StartTradeDate) And DateTime.Parse(x(“Trade Date”).ToString)<= DateTime.Parse( In_EndTradeDate)).CopyToDataTable()
Filter Th FX Data Table: String was not recognized as a valid DateTime.
Can someone help me out here
Thanks in advance,