That's a slightly misleading error message. The
real problem is that you're missing an
=
in your second condition:
h == Convert.ToInt32(TextBox1.Text)
With only a single
=
, you're setting the value of
h
to the value from
TextBox1
, rather than comparing it.
NB: You should probably use
Int32.TryParse[
^] instead of
Convert.ToInt32
, to avoid getting an exception if the user enters something that can't be converted to an integer.