qty is define as double and when i tried to execute the following code, it still gives me an error message saying Conversion from string "Update PadFile SET soh =" to type 'Double' is not valid. Which part of the code went wrong ?
VB.NET:
Private Sub updateQuantity(ByVal stockType As String, ByVal dateStart As String, ByVal apnnumber As String, ByVal storeNo As String, ByVal qty As Double)
cmd.Connection = conn
conn.Open()
cmd.CommandText = "UPDATE PadFile SET soh = " + qty + " WHERE date = '" + dateStart + "' AND apn = '" + apnnumber + "' AND store = '" + storeNo + "'"
If (cmd.ExecuteNonQuery() = 0) Then
cmd.CommandText = "INSERT INTO PadFile(date, apn, store, soh) VALUES('" + dateStart + "','" + apnnumber + "','" + storeNo + "'," + qty + ")"
cmd.ExecuteNonQuery()
End If
conn.Close()
End Sub