Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

referring to different columns of a combobox

Options
  • 12-11-2008 6:01pm
    #1
    Closed Accounts Posts: 2,268 ✭✭✭


    I have a combobox called cboUsers I fill it with a two column stored procedure
    Select UserID, UserName 
    From Users
    

    UserName is displayed.

    That is what I want.

    But...

    I need to get the value UserID

    Now I know that UserID is a valuemember for this combobox but how do I get the value without showing the number?

    MM


Comments

  • Registered Users Posts: 610 ✭✭✭nialo


    what language?


  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    If it's .Net the combobox has a selectedvalue property.


  • Closed Accounts Posts: 2,268 ✭✭✭mountainyman


    I can't believe I didn't post the language.

    It's VB.net

    Sorry again.


  • Registered Users Posts: 610 ✭✭✭nialo


    As stevenmu said its SelectedValue or SelectedItem.Value. although if there is No selectedItem then you will get a null exception.


Advertisement