I am working an project that uses federal holidays to send emails differently. I store the holidays in excel file then read into datatable at runtime. After the holidays are read into datatable, I tried to loop via the holidays list to test for the day of month and the month is equal to current date’s day of month and current month in the if activity.
The logic goes as follow:
forEach item in holidays{//forEach activity ===>no issues at until here
if(item.Day.ToString.Equals(currentDate.Day.ToString) And item.Month.toString.Equals(currentDate.Month.ToString)){//if activity: Error occurs here: Option strict disallows late binding
isHoliday = True; //assign activity
}else{
isHoliday = False;
}
}
Why Am I getting this issue. Given that the holidays variable is a list of DayTime as well as currentDate