j'ai un combobox contient des code, et je veux a la suite d'un code sélectionné afficher dans un label le nom correspond ce code !!
voilà mon essai:
je suis bloquée içi.. comment je peux récupérer la valeur de la requête et met dan label
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16string c = cbxCodeformation.Text; int c = int.Parse(cf.ToString()); try { OleDbConnection maconnexion = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=..\\..\\gestion.mdb"); maconnexion.Open(); OleDbCommand cmd = new OleDbCommand("select intitulé from diplome where code='" + c + "';", maconnexion); OleDbDataReader rdr = cmd.ExecuteReader(); ............................. } catch (Exception ex) { MessageBox.Show(ex.Message); } }![]()







Répondre avec citation
Partager