Hello there,
How to add items in combo box from mysql database?

'mySQL statement
'tryCatch method

ComboBox1._______ = myReader.GetValue(myReader.GetOrdinal("Uname"))

I'm trying use this:

ComboBox1.items = myReader.GetValue(myReader.GetOrdinal("Uname"))

but an error occured.

It helps if you post the error message, but to add items to a combobox the syntax is

ComboBox1.Items.Add(string value)

in your case


I did not use yet the Items.Add systax. Instead, I use this:

ComboBox1.Text = myReader.GetValue(myReader.GetOrdinal("Uname"))

just for comparizon.

ComboBox1.Text is the text from the currently selected item.