Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 528.1k

Error - Operator < cannot be applied to operands

Apr 18 2023 9:52 AM

Hi

  On below line i am getting error - Operator < cannot be applied to operands of type String and DateTime?

var SessionDate = ((Literal)e.Item.FindControl("ltrlLastSessionDate")).Text;
if (Convert.ToDateTime(SessionDate).ToString("dd-MM-yyyy") < objGrpResult.GrpSessionStartDate)

 


Answers (3)