title: Cant get data from a specific Table in MySQL to a Vb.net Combo box
body: <p>So here's my problem, I have a combo box that I want to fill with data from a table in MySql on load. I used this code for doing that:</p>
  <pre><code> Dim strSQL As String = &quot;SELECT containers FROM tbl_items_containers&quot;
          Dim da As New MySqlDataAdapter(strSQL, SQLConnection)
          Dim cmd As New MySqlCommand
          Dim ds As New DataSet
  
          SQLConnection.ConnectionString = ServerString
  
          cmd.Connection = SQLConnection
  
          da.Fill(ds, &quot;tbl_items_containers&quot;)
          With cb_container_type
              .DataSource = ds.Tables(&quot;tbl_items_containers&quot;)
              .DisplayMember = &quot;containers&quot;
              .ValueMember = &quot;containers&quot;
              .SelectedIndex = 0
  
          End With
  </code></pre>
  <p>The error shown whenever i run it is:</p>
  <blockquote>
  <p>An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll</p>
  <p>Additional information: InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.</p>
  </blockquote>
  <p>Now here's the thing, I tried getting data from another table in the same database and the code worked. My combo box was populated with data. I assumed that the problem is in the database, But I'm really lost here. I have no idea what to do. Any Ideas as to what may have cause the error? Thanks in advance.</p>