title: How to save vb.net combobox content into mysql table?
body: <p>I have an issue here .. i cant save combobox content into my table ... all other data are successfully saved but the combo box is saved either 1 or zero .. what seems to be wrong?</p>
  
  <p>My tables are designed through navicat .. does this have anything to do with my choice of data type? knowing that I chose the data type to be Text</p>
  
  <p>This is my code and it shows no run errors</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
          Dim conStr As String = ("Data Source=localhost;user id=root;password=123456;database=sam;")
          Try
              Dim con As New MySqlConnection(conStr)
              Dim cmd As MySqlCommand
  
              For i = 0 To ComboBox4.Items.Count
                  con.Open()
  
                  Dim sqls As String = "INSERT INTO initial_nom(f_name,s_name,th_name,fo_name,app_no,adm_type) VALUES('" &amp; TextBox1.Text &amp; "', '" &amp; TextBox2.Text &amp; "', '" &amp; TextBox3.Text &amp; "', '" &amp; TextBox4.Text &amp; "'," &amp; TextBox5.Text &amp; ",'" &amp; ComboBox4.SelectedIndex.ToString &amp; "')"
                  cmd = New MySqlCommand(sqls, con)
                  cmd.ExecuteNonQuery()
              Next
          Catch ex As Exception
              MsgBox("Error in saving to Database. Error is :" &amp; ex.Message)
          End Try
      End Sub
  </code></pre>