title: Visual Basic error 'Incorrect syntax near ')'.'
body: <p>I am using Visual Studio 2019 community version and I have a form I connected to SQL server, the connection test was successful with my visual basic form. however when I try putting in data to the database I get the error on line 14</p>
  
  <blockquote>
    <p>System.Data.SqlClient.SqlException: 'Incorrect syntax near ')'.'</p>
  </blockquote>
  
  <p>Here is my code: where have I gone wrong?</p>
  
  <pre class="lang-vb prettyprint-override"><code>Imports System.Data.SqlClient
  Public Class Form1
  Dim name, hello, eligible As String
  Dim blood As String
  Dim agree As String
  
  Dim connection As New SqlConnection("Server = DESKTOP-SNVR5AC; Database = bloodform; Integrated security = true")
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
      'connection
      Dim command As New SqlCommand("insert into form(Full_name,DOB,Email,Town,Blood_type,Age,Previous_donation,Any_diseases,Positive_bloodtest,Cardiac_problems,Bleeding_disorders) values ('" &amp; TextBox1.Text &amp; "','" &amp; DateTimePicker1.Text &amp; "','" &amp; TextBox2.Text &amp; "','" &amp; ComboBox2.Text &amp; "','" &amp; ListBox2.Text &amp; "','" &amp; ComboBox1.Text &amp; "','" &amp; GroupBox1.Text &amp; "','" &amp; GroupBox2.Text &amp; "','" &amp; GroupBox3.Text &amp; "','" &amp; GroupBox4.Text &amp; "','" &amp; GroupBox5.Text &amp; "',)", connection)
  
      connection.Open()
  
      If command.ExecuteNonQuery() = 1 Then
          MsgBox("Application submitted")
      Else
          MsgBox("Application not submitted")
      End If
  
      connection.Close()
  
      'checkbox
      If CheckBox1.Checked = False Then
          agree = "Please Agree the Terms and Conditions"
          MsgBox(agree)
      ElseIf CheckBox1.Checked = True Then
  
          'welcome message
          name = (TextBox1.Text)
          hello = "Welcome"
          MsgBox(hello &amp; Space(2) &amp; name)
  
          'age eligibility 
          If ComboBox1.SelectedIndex = 0 Then
              eligible = "You are underage"
              MsgBox(eligible)
          ElseIf ComboBox1.SelectedIndex = 1 Then
              eligible = "You can donate blood."
              'MsgBox(eligible)
  
              'blood
              If ListBox2.SelectedItem.ToString() = "Apositive" Then
                  blood = "You are A+ and can donate to A+ and AB+"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "Bpositive" Then
                  blood = "You are B+ and can donate to B+ and AB+"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "Opositive" Then
                  blood = "You are O+ and can donate to O+, A+,  B+ and AB+"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "ABpositive" Then
                  blood = "You are AB+ and can donate to AB+"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "Anegative" Then
                  blood = "You are A- and can donate to  A+, A-, AB+ and AB-"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "Bnegative" Then
                  blood = "You are B- and can donate to B+, B-, AB+ and AB-"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "Onegative" Then
                  blood = "You are O- and can donate to Everyone"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
              ElseIf ListBox2.SelectedItem.ToString() = "ABnegative" Then
                  blood = "You are AB- and can donate to AB+ and AB-"
                  MsgBox(eligible &amp; Space(1) &amp; blood)
  
              End If
          End If
      End If
  End Sub
  End Class
  </code></pre>