how to fill combobox from database in vb.net
  • Hi i want to know how can fill combo box from database using vb.net.i want to retrieve data from database and populate it in combobox. 
  • 1 Comment sorted by
  • 1) there are two methods for load data from database into combobox( by wizard , by code)

    2) Dim con As New SqlConnection("Data Source")
    Dim cmd As New SqlCommand("Select id from Testing", con)
    Dim da As New SqlDataAdapter(cmd)
    Dim dt As New DataTable()
    da.Fill(dt)
    If dt.Rows.Count > 0 Then
    ComboBox1.DataSource = dt
    ComboBox1.DisplayMember = "id"
    Else
    MessageBox.Show("Empty")
    End If

    for further details and related topics http://www.codecorner.somee.com/

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

    Optimum Creative