j 3 table(produit,commande,commandedet) et j voudrais affiche les commande d'un produit dont la référence sera sectionner via un combobox.
mon problème c'est que a l'exécution j n'arrive a lire que la première commande de mon tableau commande( première ligne) et elle s'affiche sur mon datagrid pour les autres produit rien ne se produit
donc voila mon code:
et merci
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
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 strQuery = "SELECT * FROM llx_product where ref='" & ComboBox1.Text & "'" strQuery1 = "SELECT * FROM llx_commandedet" strQuery2 = "SELECT * FROM llx_commande" myCommand.Connection = conn myCommand1.Connection = conn1 myCommand2.Connection = conn2 myCommand.CommandText = strQuery myCommand1.CommandText = strQuery1 myCommand2.CommandText = strQuery2 dr = myCommand.ExecuteReader() dr1 = myCommand1.ExecuteReader() dr2 = myCommand2.ExecuteReader() DataGridView1.Rows.Clear() DataGridView1.ColumnCount = 6 DataGridView1.Columns(0).Name = "référence" DataGridView1.Columns(1).Name = "date de commande" DataGridView1.Columns(2).Name = "réf client" DataGridView1.Columns(3).Name = "total_ht" DataGridView1.Columns(4).Name = "total_ttc" DataGridView1.Columns(5).Name = "date de livraison" While dr.Read() While dr1.Read() While dr2.Read() If (dr1(2) = dr(0) And dr2(0) = dr1(1)) Then DataGridView1.Rows.Add(dr2(4), dr2(9), dr2(5), dr2(20), dr2(21), dr2(28)) End If End While End While End While![]()
Partager