I Have a form and I like to retrieve all the columns in MySql database and display it using comboBox in vbNET. I dont know how to query that. Heres my sample codes:
conn = New MySqlConnection conn.ConnectionString = "server=localhost; userid=root; password=root; database=dbase"
Dim da As New MySqlDataAdapter
Dim dt As New DataTable
Dim bs As New BindingSource
Dim ds As New DataSet
Try
ds.Clear()
conn.Open()
cmd = New MySqlCommand("[watt??]")
da = New MySqlDataAdapter(cmd)
da.SelectCommand.Connection = conn
da.Fill(ds, "gradelvl")
cbGradeLvl.Text = ds.Tables(0).Rows(0).Item(0)
Catch ex As MySqlException
MsgBox(ex.Message)
Finally
conn.Close()
End Try