Under normal circumstances, I would look at that code and try to work out what is wrong.
But in this case, I'm not going to, because the code is clearly so poorly written, and fixing it's problem-as-seen-by-you is just the least of it's problems.
No.
Throw that lot in the bin. Sit down and think about what you are trying to do and start again from scratch. And this time, forget that the keyword
goto
ever existed. Do not write code like this again:
if ((rdr.Read() == true))
{
textBox21.Text = (rdr["CustomerID"].ToString());
textBox22.Text = textBox21.Text;
if (textBox22.Text != null)
{
goto l;
}
goto l;
}
Ever. In fact, do not use a label, or
goto
for at least five years. By then, you should understand when it is and isn't appropriate...