I assume
DoNotb
is your
TextBox
? In that case your last line of code should be turned around:
dono = reader["DoNo"].ToString();
DoNotb.Text = dono;
You are currently giving the
dono
variable the value of your
TextBox
, which is empty.
Instead you should give your
TextBox.Text
the value of the
dono
variable, as in my code.
Do notice that the
Text
in your
TextBox
is overridden in every new iteration. So you will always end up with the value of the last row in your database.