I am trying to reduce the quantity of the stock at the time of the sale and without success, I used the code below, no error appears ..
Public Sub UpdateDecreaseQuantity()
Try
For Each row As DataGridViewRow In DataGridView1.Rows
Dim OtherValue As Integer = 0
Dim cb As String = "Update Dish SET Quantity = Quantity - @OtherValue"
con.Open()
cmd = New OleDbCommand(cb, con)
Integer.TryParse(row.Cells(2).Value, OtherValue)
cmd.Parameters.Add("@OtherValue", OleDbType.Integer).Value = OtherValue
cmd.ExecuteNonQuery()
con.Close()
Next
Catch ex As Exception
MsgBox(ex.Message)
Finally
cmd.Dispose()
con.Close()
End Try
End Sub