1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
for (int i = 0; i < listView1.Items.Count; i++)
{
d2 = 2;
if (d2.ToString() == it[i].SubItems[1].Text)
{
try
{
Program.connexion.Open();
string mySelectQuery = "SELECT Live_Operation.Label ,Nbr_Lot,Start_Date,End_Date,Oven.Temperat_Con_1,Oven.Temperat_Max_1,Oven.Rise_Time_1,Oven.Time_Level_1,Oven.Temperat_Con_2,Oven.Adresse,Oven.Temperat_Max_2 FROM Live_Operation,Oven where Live_Operation.Label=Oven.Label ";
SqlCommand myCommand = new SqlCommand(mySelectQuery, Program.connexion);
SqlDataReader myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
if (it[i].Text == myReader[0].ToString())
{
it[i].SubItems[2].Text = ("ON");
this.it[i].SubItems[0].ForeColor = Color.Pink;
t[i].SubItems[3].Text= d2.tostring();
it[i].SubItems[4].Text = myReader[1].ToString();
it[i].SubItems[5].Text = myReader[2].ToString();
it[i].SubItems[6].Text = myReader[3].ToString();
}
}
}
catch { }
}
else
{
it[i].SubItems[2].Text = ("NC");
this.it[i].SubItems[0].ForeColor = Color.Gold;
}
} |
Partager