title: vb.net problem with sql update command
body: <p>I'm looking for some help trying to figure out why I'm seeing a SQL error on an update command within vb.net, noting that my SQL experience is very limited.</p>
  
  <p>I'm in the midst of building a profile system that will be used in several other tools within our company, as part of the profile system, the user's information is queried against our LDAP directory upon page load and the data stored in variables displayed in labels on the page.</p>
  
  <p>The user then has the option to create a new profile if one does not exist, or update an existing if there is already one in place. The code determines the proper action based on a query to the table using the users employee id.</p>
  
  <p>My insert command works ok but the update does not, below is my current code and the error.</p>
  
  <p>This is the insert statement to create a new entry, this works properly.</p>
  
  <pre><code>    Protected Sub btnInsert_Click(sender As Object, e As EventArgs) Handles btnInsert.Click
      Try
          Dim con As New SqlConnection
          Dim cmd As New SqlCommand
  
          con.ConnectionString = "Data Source="server" Catalog=usertable;Integrated Security=True"
  
          con.Open()
          cmd.Connection = con
  
          cmd.CommandText = "INSERT INTO Profile (FirstName, LastName, Email, Telephone, EmployeeID, NTLogin) VALUES ('" &amp; lblFirstName.Text &amp; "','" &amp; lblLastName.Text &amp; "','" &amp; lblEmail.Text &amp; "','" &amp; lblPhone.Text &amp; "','" &amp; lblEID.Text &amp; "','" &amp; lblNT.Text &amp; "')"
  
          cmd.ExecuteNonQuery()
          btnInsert.Enabled = False
          lblValid.Text = "Record Inserted Successfully"
          con.Close()
      Catch ex As System.Exception
          lblValid.Text = (ex.Message)
  
      End Try
  </code></pre>
  
  <p>The following is the update code that gives an error:</p>
  
  <pre><code>Protected Sub btnUpdate_Click(sender As Object, e As EventArgs) Handles btnUpdate.Click
      Try
          Dim con As New SqlConnection
          Dim cmd As New SqlCommand
  
          con.ConnectionString = "server;Initial Catalog=usertable;Integrated Security=True"
          con.Open()
          cmd.Connection = con
  
          cmd.CommandText = "UPDATE Profile (FirstName, LastName, Email, Telephone, EmployeeID, NTLogin) VALUES ('" &amp; lblFirstName.Text &amp; "','" &amp; lblLastName.Text &amp; "','" &amp; lblEmail.Text &amp; "','" &amp; lblPhone.Text &amp; "','" &amp; lblEID.Text &amp; "','" &amp; lblNT.Text &amp; "') Where [EmployeeID] = '" &amp; lblEID.text &amp; "'"
  
          cmd.ExecuteNonQuery()
          btnUpdate.Enabled = False
          lblValid.Text = "Record Updated Successfully"
          con.Close()
      Catch ex As System.Exception
          lblValid.Text = (ex.Message)
      End Try
  End Sub
  </code></pre>
  
  <p>The exception error returned is</p>
  
  <pre><code>    [SqlException (0x80131904): Incorrect syntax near '('.]
     System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +392
     System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815
     System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean&amp; dataReady) +4515
     System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +1390
     System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +538
     System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +290
     newprofile.btnUpdate_Click(Object sender, EventArgs e) +759
     System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
  </code></pre>
  
  <p>I'm at a loss and appreciate any help that can be given.</p>