private void checkDate() { if (TxtFromDate.Text >= System.DateTime.Now.Date) { } } this says that the operator cannot be applied in operands string and int