If you are databinding the control from a DataSource (DataSet, DataTable,
DataReader) that comes out of the database, you need to set the ValueMember
and the DisplayMember properties of your comboBox to the names of the ID
column and the display text column in your datasource.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.
Site:
http://www.eggheadcafe.com http://petesbloggerama.blogspot.com http://ittyurl.net
"sweetiecakes" wrote:
Yes, sorry, I accidently confused the name. I mean a ComboBox. But I
want this ID to be consistent with the database one. How would I do this?
Peter Bromberg [C# MVP] wrote:
"SelectionBox"? I've never heard of such a control. Probably you mean one of
the List derived controls like ListBox or dropdownList, etc. These usually
have a property called SelectedValue which would represent the ID vs.
SelectedText representing what the user "sees" when they make a selectio.
-- Peter
To be a success, arm yourself with the tools you need and learn how to use
them.
Site: http://www.eggheadcafe.com
http://petesbloggerama.blogspot.com
http://ittyurl.net
"sweetiecakes" wrote:
I have an dataset that populates a selectionbox. I'd like to get the
value of the column "id" of the selected item in the selectionbox
afterwards. How would I do this?