Bonjour,
je suis perdu
pour remplir mon combobox partir d'une requête sql j'ai utiliser ca
====================================================
====================================================
====================================================
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 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim MyConnexion As SqlConnection = New SqlConnection("Data Source=.\sqlexpress;" & _ "Integrated Security=SSPI;Initial Catalog=autoecole") Dim Mycommand As SqlCommand = MyConnexion.CreateCommand() Mycommand.CommandText = "SELECT * FROM charge" MyConnexion.Open() Dim myReader As SqlDataReader = Mycommand.ExecuteReader() Do While myReader.Read() ComboBox1.Items.Add(myReader.GetValue(0)) Loop myReader.Close() MyConnexion.Close() End Sub
====================================================
mon souci c'est que j'ai pas réussi a remplir un datagrid avec cette connexion a ma base de donne ?
qui peut m'orienter et me dire presqu'il faut ajouter a mon code pour réussir a remplir se datagird.
merci
Partager