title: I keep having this error 'Invalid Syntax near 'emppic' vb.net
body: <p>I've been working on saving an image to my sql database but to no avail. I keep having the same error of 'invalid syntax near @emppic'</p>
  <p>I am new to vb.net and I have tried deleting the @emppic but I get the same error, just on a different line.</p>
  <p>Here is the code:</p>
  <pre class="lang-vbnet prettyprint-override"><code>    Try
      
          Dim mstream As New System.IO.MemoryStream
          PictureBox4.Image.Save(mstream, System.Drawing.Imaging.ImageFormat.Jpeg)
          arrimage = mstream.GetBuffer()
          Dim filesize As UInt32
          filesize = mstream.Length
      
          mstream.Close()
          conn.ConnectionString = Str()
          conn.Open()
          Sql = &quot;INSERT INTO  ADDEMPLOYEE(EMPLOYEEID,FNAME,MNAME,LNAME,SEX, AGE, ADDRESS, BDAY, CONTACT,HEIGHT,WEIGHT,CITIZENSHIP,HIREDDATE, CIVILSTATUS,POSITION,USERNAME,PASSWORD,PAIDLEAVES,UNPAIDLEAVES,SSS,TIN,PHILHEALTH,PAGIBIG,EMPPIC) VALUES(@EMPLOYEEID, @FNAME, @MNAME, @LNAME,@SEX, @AGE, @ADDRESS, @BDAY, @CONTACT, @HEIGHT,@WEIGHT,@CITIZENSHIP,@HIREDDATE, @CIVILSTATUS,@POSITION,@USERNAME,@PASSWORD,@PAIDLEAVES,@UNPAIDLEAVES,@SSS,@TIN,@PHILHEALTH,@PAGIBIG, @EMPPIC&quot;
          cmd.Connection = conn
          cmd.CommandText = Sql
      
          cmd.Parameters.AddWithValue(&quot;@EMPLOYEEID&quot;, AE_EID.Text)
          cmd.Parameters.AddWithValue(&quot;@FNAME&quot;, AE_FNAME.Text)
          cmd.Parameters.AddWithValue(&quot;@MNAME&quot;, AE_MIDNAME.Text)
          cmd.Parameters.AddWithValue(&quot;@LNAME&quot;, AE_LASTNAME.Text)
          cmd.Parameters.AddWithValue(&quot;@SEX&quot;, AE_SEX.Text)
          cmd.Parameters.AddWithValue(&quot;@AGE&quot;, AE_AGE.Text)
          cmd.Parameters.AddWithValue(&quot;@ADDRESS&quot;, AE_ADDRESS.Text)
          cmd.Parameters.AddWithValue(&quot;@BDAY&quot;, AE_BDAY.Text)
          cmd.Parameters.AddWithValue(&quot;@CONTACT&quot;, AE_CONTACT.Text)
          cmd.Parameters.AddWithValue(&quot;@HEIGHT&quot;, AE_HEIGHT.Text)
          cmd.Parameters.AddWithValue(&quot;@WEIGHT&quot;, AE_WEIGHT.Text)
          cmd.Parameters.AddWithValue(&quot;@CITIZENSHIP&quot;, AE_CITI.Text)
          cmd.Parameters.AddWithValue(&quot;@HIREDDATE&quot;, AE_HIREDATE.Text)
          cmd.Parameters.AddWithValue(&quot;@CIVILSTATUS&quot;, AE_CS.Text)
          cmd.Parameters.AddWithValue(&quot;@POSITION&quot;, AE_POSITION.Text)
          cmd.Parameters.AddWithValue(&quot;@USERNAME&quot;, AE_USERNAME.Text)
          cmd.Parameters.AddWithValue(&quot;@PASSWORD&quot;, AE_PASSWORD.Text)
          cmd.Parameters.AddWithValue(&quot;@PAIDLEAVES&quot;, AE_PL.Text)
          cmd.Parameters.AddWithValue(&quot;@UNPAIDLEAVES&quot;, AE_UPL.Text)
          cmd.Parameters.AddWithValue(&quot;@SSS&quot;, AE_SSS.Text)
          cmd.Parameters.AddWithValue(&quot;@TIN&quot;, AE_TIN.Text)
          cmd.Parameters.AddWithValue(&quot;@PHILHEALTH&quot;, AE_PHIL.Text)
          cmd.Parameters.AddWithValue(&quot;@PAGIBIG&quot;, AE_PAGIBIG.Text)
          cmd.Parameters.AddWithValue(&quot;@EMPPIC&quot;, arrimage)
      
          Dim r As Integer
          r = cmd.ExecuteNonQuery()
          If r &gt; 0 Then
              MsgBox(&quot;successfully added&quot;)
          Else
              MsgBox(&quot;fail to save&quot;)
          End If
          cmd.Parameters.Clear()
          conn.Close()
      
      
      Catch ex As Exception
          MessageBox.Show(ex.Message)
      End Try
  </code></pre>