Creating a loop that will edit 60 TextBox names?
Posted
by Darkmage
on Stack Overflow
See other posts from Stack Overflow
or by Darkmage
Published on 2009-09-17T13:06:18Z
Indexed on
2010/05/30
10:42 UTC
Read the original article
Hit count: 280
text box set1 = 1 to 30 = in the query name = br1id to br30id
textbox set 2 = 1 to 30 = in the result output
i dont understand how to create a loop based on 30 diffrent textbox names?
i cant copy paste these lines 30 times editing the textbox names, that wold just look wrong.
try
{
MySqlConnection mysqlCon = new MySqlConnection(
"server= 195.159.253.229;" +
"Database = bruker;" +
"user id=bobby;" +
"password=LoLOW###;");
MySqlCommand cmd1 = new MySqlCommand(
"SELECT brukernavn From bruker where ID = '" + br1id.Text + "';", mysqlCon);
mysqlCon.Open();
navX[0] = cmd1.ExecuteScalar().ToString();
br1txt3.Text = navX[0];
}
© Stack Overflow or respective owner