Is it possible to change the arrayname in a for loop? My Arrays are called T1, T2 T3... now I want to replace the number behind the T into an int. Here my code:
sql = con.CreateCommand();
sql.CommandText = "select [ZeitH] from [Tisch 1] where [Datum]='" + datum + "';";
OleDbDataReader reader = sql.ExecuteReader();
while (reader.Read())
{
for (int i = 0; i <= 10; i++)
{
if (reader.GetInt32(0).ToString() == (i + 10).ToString())
{
T1[i] = false;
T1[i + 1] = false;
T1[i + 2] = false;
T1[i + 3] = false;
}
}
}
ifstatement as normal vertical statements. Even if you'd normally put several statements on a line in your code (which I wouldn't recommend) it makes things particularly hard to read on Stack Overflow where there is limited horizontal space.T[][]and useforloop to iterate through your arrays.