Bonjour,
J'aimerais remplir une combo box avec le resultat d'une requete sql.
Pour l'instant je peux me connecter et executer ma requete:
Mais je ne sais pas comment remplir ma combo box. Je ne veux pas utiliser la fenetre Propriete de visual studio. Je veux le faire a la main
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 Dim con As New SqlConnection(connString) Dim dr As SqlDataReader Dim myCommand As SqlCommand Dim sql As New StringBuilder sql.Append("select distinct ViewTable ") sql.Append("from Fields where ViewTable in ") sql.Append("(select table_name ") sql.Append("from information_schema.tables ") sql.Append("where table_type='VIEW')") Dim test As String = sql.ToString myCommand = New SqlCommand(sql.ToString, con) con.Open() dr = myCommand.ExecuteReader() con.Close()
Merci pour votre aide.
Partager