More Combo box binding Problems!
Posted on 2004-08-18
I have a combo box which should populate with 'States' (NSW, QLD, VIC, WA etc.).
I then expect it to get it's value from the database just like all the other bound fields when I fill the dataset containing POHEADER table.
I have the following settings:
A DataSet called DsPurchaseOrder1 which contains a table called POHEADER.
A combo box called cmbState which has a collection of values (NSW, QLD, VIC, WA etc.)
The combo box has the following properties:
SelectedValue is DsPurchaseOrder1 - POHEADER.PO_SUPP_STATE
Why won't the combo box dispaly the value from POHEADER.PO_SUPP_STATE?
What should i put in the ValueMember property? I believe I need something here so that when the value has been changed by the user and we want to update the database it needs to know what value to use. Or does it just use the displayed text if this property is left blank?
Are there any other properties that need to be set on the combo box to do what I'm trying to do?
I seem to be able to get this to work on other combo boxes where the datasource is another table in the dataset rather than a collection of values.
Is this the only way to do it? I don't really want to create a table in the database or dataset for a static table such as States.
Thanks in Advance.