Bonjour @ tous,

je travail avec mysql et et suis revenu à vb express 2005 depuis

voila mon probléme
je voudrais afficher dans ma fenêtre un control du style ComboBox mais avec un champ caché qui contiendrait (l'id des enreg de ma table)
j'ai essayé de voir s'il y avait possibilité de modifier l'index mais non

quelqu'un à une idée

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
 
Private Sub InitCbListContact()
        Dim myCommand As MySqlCommand = myConnection.CreateCommand
        myCommand.CommandText = "SELECT * FROM tblcontact"
        Dim myReader As MySqlDataReader = myCommand.ExecuteReader
 
        Do While myReader.Read()
            Dim StringCbListContact As String
 
            If myReader.GetValue(1) Is DBNull.Value Then
                StringCbListContact = myReader.GetValue(2) & " " & myReader.GetValue(3) 'affiche le nom et prénom dans le cas d'une personne physique
            Else
                StringCbListContact = myReader.GetValue(1) 'affiche le nom du siège social dans les autres cas
            End If
            CbListContact.Items.Add(StringCbListContact)
        Loop
        myReader.Close()
    End Sub