private void BT_Ajouter_Circuit_Click(object sender, EventArgs e) { Ajouter dlg = new Ajouter(); if (dlg.ShowDialog() == DialogResult.OK) { Afficher(); LB_Circuit.Refresh(); } }
private void Afficher() { try { if (LB_Circuit.Items.Count != 0) { LB_Circuit.Items.Clear(); LB_Circuit.Refresh(); } string sql5 = "select nom from circuit"; OracleCommand oraComm5 = new OracleCommand(sql5, connection); OracleDataReader oraReader5 = oraComm5.ExecuteReader(); while (oraReader5.Read()) { LB_Circuit.Items.Add(oraReader5.GetString(0)); LB_Circuit.Refresh(); } } catch (Exception sqlConnex) { MessageBox.Show(sqlConnex.Message.ToString()); } }