Ajouter des éléments dans une ListBox
Bien le bonjour !
Je souhaiterais ajouter des éléments dans une listbox sur mon appli web, je parviens à ajouter des éléments, mais j'aimerais également pouvoir y spécifier une valeur, via le champ "Value" et non un index comme le permet la méthode Items.Insert
Quelqu'un sait comment je peux faire ça ? Voici mon code actuel, qui affiche mes valeurs dans un msgbox ...
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
| Dim Connexion As New SqlConnection(ConfigurationManager.ConnectionStrings("Formation_2014ConnectionString").ConnectionString)
Try
Connexion.Open()
Dim Requete As String = "SELECT * from Formation"
Dim Commande As New SqlCommand(Requete, Connexion)
Dim Adaptateur As New SqlDataAdapter(Commande)
Dim MonDataSet As New DataSet
Try
Adaptateur.Fill(MonDataSet, "Formation")
For Each Ligne As DataRow In MonDataSet.Tables("Formation").Rows()
MsgBox(Ligne("id_formation").ToString & " - " & Ligne("libelle_formation").ToString)
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
Catch ex As Exception
MsgBox(ex.Message)
End Try |
Voila Voila ! Merci d'avance !
Krishnak