Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to take advantage of ListBox.ValueMember
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
How to take advantage of ListBox.ValueMember
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01209815
Message ID:
01209815
Vues:
109
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
Fil
Voir

Click here to load this message in the networking platform