3
Answers

Error - Operator < cannot be applied to operands

Ramco Ramco

Ramco Ramco

1y
486
1

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)