How to Populate ComboBox from access db in C#

Posted by Bomboe Cristian on Stack Overflow See other posts from Stack Overflow or by Bomboe Cristian
Published on 2010-05-11T10:28:15Z Indexed on 2010/05/11 10:34 UTC
Read the original article Hit count: 208

Filed under:
|
|

I have the next combobox:

this.comboBoxProd.Enabled = false;
this.comboBoxProd.FormattingEnabled = true;
this.comboBoxProd.Items.AddRange(new object[] {
            "Cameras",
            "------------",
            " Digital IXUS 850 IS ",
            " Digital IXUS 900 Ti ",
            " Digital IXUS 75 -NEW- ",
            " Digital IXUS 70 -NEW- ", etc.

I want to change it and take the values from a db. My database name is bd1.mdb and in the table Cameras it has the following fields: CamID, Cameras, Warranty, Year. I am only interested in the "Cameras" field. Thank you!

© Stack Overflow or respective owner

Related posts about combobox

Related posts about c#