General information
Title:
How to take advantage of ListBox.ValueMember
Environment versions
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only