Click here to Skip to main content
15,888,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
combo box(vb.net)i need to fall option that stored in ms access how to do that
Posted

1 solution

Hi Morrish,

You need to fill the combobox using Dataset.
Here's how you could do it.

VB
Dim conn As New SqlConnection(connString)

Dim strSQL As String = "SELECT * FROM Disk"
Dim da As New SqlDataAdapter(strSQL, conn)
Dim ds As New DataSet
da.Fill(ds, "Disk")

With ComboBox1
    .DataSource = ds.Tables("Disk")
    .DisplayMember = "Disk_Name"
    .ValueMember = "Disk_Key"
    .SelectedIndex = 0
End With
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900