Information générale
Titre:
How to take advantage of ListBox.ValueMember
Versions des environnements
Network:
Windows 2003 Server
This relates to my other posting.
I'm developing a WinForms application that uses a ListBox. The listbox is populated from the Sessions table of my database. There are two fields in this table that I am particularly interested in: 'date' (this is the field I want displayed in the ListBox), and SessionID (the primary index of the record in the Sessions table containing that date). When the user selects a date in the ListBox, I want to retrieve the corresponding SessionID.
I was under the impression that the ValueMember property of the ListBox would enable me to do this.
I have set the "DisplayMember" propery of the ListBox to the date field, and the "ValueMember" property to the sessionid field.
How do I get the SessionID value when the user selects a date in the ListBox?
Thanks,
Jim
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement