i got create combobox and i want show item at combobox from my database data.

i set datasource from properties..
but for displaymember i try to use coding.

cmbPelan.DisplayMember = "Pelan"
cmbPelan.SelectedIndex = -1

but result like image me attach.
i want my combobox show item like
1
2
3

anyone can help me?

Post all of your code so I can look at it.

my coding for combobox just that..
becouse for that combobox datasource i set at properties.

So your just trying to populate a combo box then? First you need to set up your sql connection object, then your sql data adapter object. Make sure your able to connect to your database. Open a connection on your form load event then try something like this:

Dim "yourdataset" as new dataset

SqlDataadapter1.selectcommand.commandtext = "Your select statement used for the combobox"

SqlDataadapter1.fill("Your dataset")

Combobox1.DataSource = yourdataset.tables(0)
Combobox1.displaymember = yourdataset.tables(0).Columns(0).ColumnName

thank you...
i will try 1st..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.