Bonjour à tous,
J'ai besoin de votre aide (ben oui pour changer...)
Voilà j'utilise SQLite et je souhaiterais afficher le champ lieu de ma table T_Saut.
Voici ce que j'ai codé, mon messageBox de controle s'affiche ("affichage ok") mais rien n'apparait dans la listBox...
:(
Si qqun peut m'aider rapidement, ça serait juste génial... d'avance MERCI...Code:
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 try { cnn.Open(); DbTransaction trans = cnn.BeginTransaction(); DbCommand cmm = cnn.CreateCommand(); cmm.Transaction = trans; cmm.CommandText = "SELECT Lieu FROM T_Saut"; using (DbDataReader rs = cmm.ExecuteReader()) { while (rs.Read()) { // listBox2.Text += rs.AddItem.ToString() + "\r\n"; // j'ai essayé ces 2 méthodes mais rien ne marche... listBox1.DisplayMember = "Lieu"; } } cmm.ExecuteNonQuery(); trans.Commit(); cnn.Close(); // fermeture de la fenêtre DialogResult exitConfirm1 = (MessageBox.Show("affichage ok", "Test", MessageBoxButtons.OK)); this.Close(); } catch (Exception exception) { Console.WriteLine("Exception occured"); }