Ad Code

Responsive Advertisement

Load data from MySQL to Combobox in vb.net

This tutorial is all about "Load data from MySQl to Datagridview in vb.net".


This tutorial will show you on how to load a specific column data from MySQL database to your combobox element in VB.Net. Combobox is like a text box that can accept all characters but this type of element shows a drop-down type data.


Please use the code below:

Try
Str = "select * from fiber_type"
conn.Open()
Dim da As New MySqlDataAdapter(Str, conn)
Dim dt As New DataTable("fiber_type")
da.Fill(dt)
If dt.Rows.Count > 0 Then
cboSignUpFor.DataSource = dt
cboSignUpFor.DisplayMember = "description"
cboSignUpFor.ValueMember = ""
End If
conn.Close()
Catch ex As Exception
MsgBox(ex.Message)
conn.Close()
End Try
Related Topics You May Like:
Generate/View Report using CrystalReport in Vb.Net
Automatically clear text field in VB.Net
Load the data from MySQL to DatagridView VB.Net

Post a Comment

0 Comments

Close Menu