V
Vayse
Has anyone an example of filling a combo box with a data reader?
Thanks
Vayse
Thanks
Vayse
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Vayse said:Selectecd Value = AssetsBindingSource - CostCentre
I have the combo box filling correctly, thanks to your code. But it
doesn't display the select CostCentre correctly, and its not updating the
Asset.
What step am I missing?
Vayse said:Just to make it clear - I've removed the CostCentresTableAdapter and those
databound properties. Thats as they were before I used the Datareader.

Vayse said:Selected Value = AssetsBindingSource - CostCentre
If you look at the property, thats the way its displayed! Not a
calculation or anything, just means Assets.CostCentre
Also displayed that way if you click the smart tag. Kind of strange
really.
And yes, the selected value in the combo box is not sticking. Also, its
not been filled correctly.
So when I navigate to a new record, the combo box is blank.

I can get really makes me confused. Thanks

"Jeffrey Tan[MSFT]" said:Hi Vayse,
Thanks for your feedback, see inline.
Of cause, we can use combobox without databinding. We can just use
ComboBox.Items.Add method to add the display items programmatically.
update the field.
This depends on what does "field" pointed to, certain field in underlying
DataTable/DataSet or certain field in some table in DataBase.
Normally, after we selected an item, click a update button to update the
underlying datasource, we should use some primary key information(this
primary key information should store with other information in the item of
the combobox) to look the related row in DataTable/DataSet, then change
the
corresponding column value in that row to your selected value.
To update the database table, you can use ADO.net with SQL statement to
update the change data into the database.
Hope this helps
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.