This code is a simplified version of what I'm trying to do:
string day = Thursday;
DateTime dt = DateTime.Now;
if (day == dt.DayOfWeek)
{
// start the program
}
I need to read a day of the week value from a database, assign it to a string, then compare the string to dt.DayOfWeek to check if the program should execute.
My error is this: "Operator '==' cannot be applied to operands of type 'string' and 'System.DayOfWeek"
Anyone know how to compare a string to a DateTime.DayOfWeek value?