title: Populate combobox with data from MySQL
body: <p>I'm trying to populate my combobox with data from a table in mysql, here is my code, I can't see what the issue is. My combobox doesn't return any data, it is just blank.</p>
  
  <pre><code>    Private Sub cbxCompanyName_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cbxCompanyName.SelectedIndexChanged
      Dim con As New MySqlConnection
      Dim constr As String = "Server=localhost;database=ba-solutions;user id=root;password="
      Try
          con.ConnectionString = constr
          con.Open()
      Catch ex As SqlException
          MsgBox(ex.Message)
      End Try
  
      Dim StrSql As String = "SELECT Company Name FROM client_details"
      Dim cmd As New MySqlCommand(StrSql, objconnection)
      Dim da As MySqlDataAdapter = New MySqlDataAdapter(cmd)
      Dim dt As New DataTable("Client_details")
  
      da.Fill(dt)
  
  
      If dt.Rows.Count &gt; 0 Then
  
          cbxCompanyName.DataSource = dt
          cbxCompanyName.DisplayMember = "Company Name" 'What is displayed
  
      End If
  
  End Sub
  </code></pre>