Results 1 to 2 of 2

Thread: Populating a combobox with different display and value members

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2002
    Location
    Colorado
    Posts
    23

    Populating a combobox with different display and value members

    I want to populate a combobox with a list that displays one field, but has the value of another using the datareader object.

    I am able to do this with a dataset and using the displaymember and valuemember properties of the combobox. However, I'm trying to make the procedure run as quickly as possible. Since I won't be updating the data at all, I figure using a datareader object would be faster, but I'm not sure how to populate a combobox with two values (the displaymember and the valuemember) using a datareader. Can anyone help me here?
    LDD
    ----------------
    "Character is what you do in the dark." Dwight L. Moody

  2. #2
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    Dublin (Ireland)
    Posts
    304
    haven't tried any code for this, but a combox box has 2 properties, one is selectedtext (which is what you see) and one is selectedvalue which normally are one and the same but of course can be different - try setting the two values differently and experiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width