ASP.NET SQL Command Error UPDATE “Near Syntax \ ”

Scraple

New Member
What i'm trying to do is that from a ASP.NET (framework 4) a user shall be able to update an existing record in a SQL Database using the record Key. USING Visual Studio 2010 (vb)I get an error of Syntax near " \ ", i have 2 textboxes:1- For the key2-contains the information that would be sent to the SQL server in order to update such column (Control_ClosedByRev)\[code\]Dim Con As New SqlConnection Dim SQL As String Dim com As SqlCommand = Con.CreateCommand Dim KeyID As Integer KeyID = TextBox1_UpdateDataReview.Text Con.ConnectionString = "Data Source=WCRDUSMJEMPR9\SQLEXPRESS;Initial Catalog=MicroDB;Integrated Security=True" Con.Open() SQL = "UPDATE ControlCharts set Control_ClosedByRev=" & TextBox2_UpdateDataReview.Text & " where ID_ControlCharts= " & KeyID Dim cmd As New SqlCommand(SQL, Con) 'cmd.ExecuteScalar() cmd.ExecuteNonQuery() Label1_UpdateDataReview.Text = "Record Updated"\[/code\]i tried changing the cmd.execute, it did not work. Thanks in advance.
 
Back
Top