0

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.

Edited by monching

2
Contributors
3
Replies
9
Views
4 Years
Discussion Span
Last Post by Reverend Jim
0

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

ComboBox1.Items.Add(myReader("Uname"))
0

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

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

just for comparizon.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.