I'm having some problems with the UPDATE statement in VB.NET. Not the UPDATE statement directly, but when it comes to incrementing a field's value by 1.
Below is the code that I'm using for writing to the database, as well as the two UPDATE SQL statements that I've tried.
Any help would be appreciated...
Private Sub updateRecord(ByVal query As String) Dim connection As New MySqlConnection(connStr) Dim cmd As New MySqlCommand(query, connection) Dim rowsEffected As Integer = 0 connection.Open() rowsEffected = cmd.ExecuteNonQuery() connection.Close() End Sub
UPDATE tblfirsthalf SET ShotsInsidePA = ShotsInsidePA + 1 WHERE PlayerNumber = 1
UPDATE `ontheball`.`tblfirsthalf` SET tblfirsthalf.ShotsInsidePA = tblfirsthalf.ShotsInsidePA +1 WHERE (((tblfirsthalf.PlayerNumber)=1));