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
| private void combo_salarié_SelectedIndexChanged(object sender, EventArgs e)
{
string ComboSala;
ComboSala = combo_salarié.SelectedItem.ToString();
SqlDataAdapter command = new SqlDataAdapter("SELECT * FROM dbo.T_Temporaire where Temp_Salarie = '" + ComboSala + "' ", connexion);
command.Fill(data_temporaire2, "Temp_Periode");
command.Fill(data_temporaire2, "Temp_Service");
command.Fill(data_temporaire2, "Temp_CodeProjet");
command.Fill(data_temporaire2, "Temp_LibProjet");
command.Fill(data_temporaire2, "Temp_NbJours");
command.Fill(data_temporaire2, "Temp_Commentaires");
//Dgv_D_Salarie.DataSource = data_temporaire.Tables[0];
foreach (DataRow row in data_temporaire2.Tables[0].Rows)
{
if (j < data_temporaire2.Tables[0].Rows.Count)
{
Dgv_D_Salarie.Rows[j].Cells[1].Value = row["Temp_Periode"];
Dgv_D_Salarie.Rows[j].Cells[3].Value = row["Temp_Service"];
Dgv_D_Salarie.Rows[j].Cells[4].Value = row["Temp_CodeProjet"];
Dgv_D_Salarie.Rows[j].Cells[5].Value = row["Temp_LibProjet"];
Dgv_D_Salarie.Rows[j].Cells[6].Value = row["Temp_NbJours"];
Dgv_D_Salarie.Rows[j].Cells[7].Value = row["Temp_Commentaires"];
}
j++;
}
} |
Partager