title: inserting windows form data from text and combo boxes into mysql database
body: <p>i am working on an application which will allow the user to add a company via the form. i a struggling on inserting the data into the MySQL DB in the INSERT query. the query is sound as it will work when directly applied, however the application won't commit...here is my code below...</p>
  
  <pre><code>Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  
             sqlconnection.Close()
  
  Dim com As New MySqlCommand("INSERT INTO companies VALUES(company_id, '" &amp; TextBox1.Text &amp; "', '" &amp; RichTextBox1.Text &amp; "', '" &amp; TextBox4.Text &amp; "', '" &amp; TextBox5.Text &amp; "', '" &amp; ComboBox6.Text &amp; "', '" &amp; TextBox2.Text &amp; "', '" &amp; TextBox7.Text &amp; "', '" &amp; TextBox3.Text &amp; "', '" &amp; ComboBox2.Text &amp; "', '" &amp; RichTextBox3.Text &amp; "', '" &amp; ComboBox5.Text &amp; "', '" &amp; RichTextBox2.Text &amp; "', '" &amp; ComboBox7.Text &amp; "', '" &amp; ComboBox1.Text &amp; "', '" &amp; ComboBox4.Text &amp; "';", con)
  
          con.Open()
  
          com.ExecuteNonQuery()
  
          con.Close()
  
          MsgBox("committed")
  </code></pre>
  
  <p>Thanks in advance</p>