Continuing on from my adding data to the db I am using the following to try and update the db
End If
'Refresh_Form()
conn.Close()
'update property table
Dim connUpString As String = My.Settings.strConn
Dim connUp As New SqlConnection(connUpString)
Dim cmdUp As New SqlCommand
Try
connUp.Open()
cmdUp.Connection = connUp
cmdUp.CommandText = "UPDATE property SET available = @available WHERE propRef = @propRef, cmdUp"
cmdUp.Parameters.AddWithValue("@available", False)
cmdUp.Parameters.AddWithValue("@propRef", Me.DropDownList1.Text)
Dim ok As Integer = cmdUp.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show("Error while updating record on table..." & ex.Message, "Update Records")
Finally
connUp.Close()
End Try
End If
Catch ex As Exception
MsgBox("Error: " & ex.Source & ": " & ex.Message, MsgBoxStyle.OkOnly, "Connection Error !!")
End Try
End If
End If
I get error while updating record on table...Incorrect syntax near ','.
?
I can't see where it is getting this from? the the dropdownlist.text ="RC1"