In almost all cases, when you see this exception, this is an indication of having "infinite" recursion:
Recursion in your code is apparent: this is calling
from its implementation. By why you never exit this recursion? Because
a == DateTime.Now.ToShortDateString()
always return false, so you call
over and over. You simply don't modify
. But this is not enough. The whole idea is wrong: 1) you work not with time, but with strings representing time, you need to work with
instead; 2) avoid '==' comparison with time; use '>', '<', '<=' or '<=' instead (do I even need to explain why? just try to think about it).