I am asking for help. I want to populate combo box dynamicaly using records from the database
Re: populating cobobox
Collapse
X
-
Ok which version of vb are you using......if you are using vb08 this is quite simple...Go to data bindings in the data bindings section of the properties....y ou will find 4-5 fields one is called text...the other is value and the others...i can't recall...value is the option of inserting what is in the combo to the field....text is the text that will appear in the combo box from the database fieldOriginally posted by molikoeI am asking for help. I want to populate combo box dynamicaly using records ffrom the databes -
Put you database connection script above this:
[code=vbnet]
cboLN03.Items.C lear()
Reader = Cmd.ExecuteRead er()
While Reader.Read()
For Columns = 0 To Reader.FieldCou nt - 1
Category = Reader.Item(Col umns) 'READ COLUMN FROM DATABASE
Next
cboLN03.Items.A dd(Category)
ComboRow += 1
End While
Con.Close()
[/code]
cboLN03 is the comboboxComment
Comment