Start New Discussion within our Software Development Community

guys, need help please. i have an syntax error on my update statement here is the code.

myqry = "UPDATE prodInfo SET "
myqry = myqry + " [itemName] = '" & txtName.Text & "',"
myqry = myqry + " [comboSize] = '" & combosize.Text & "',"
myqry = myqry + " [Quantity] = '" & txtQuantity.Text & "',"
myqry = myqry + " [Weight] = '" & comboweight.Text & "',"
myqry = myqry + " [price] = '" & txtPrice.Text & "',"
myqry = myqry + " WHERE "
myqry = myqry + " [itemNo] = " & txtID.Text & "'"

mycmd = New OleDbCommand(myqry, conn)
mycmd.ExecuteNonQuery()

thank you in advance.

myqry="UPDATE PRODUCTINFO SET " 
myqry = myqry + " itemName = '" & txtName.Text & "',"
myqry = myqry + " comboSize = '" & combosize.Text & "',"
myqry = myqry + " Quantity = '" & txtQuantity.Text & "',"
myqry = myqry + " Weight = '" & comboweight.Text & "',"
myqry = myqry + " price = '" & txtPrice.Text & "',"
myqry = myqry + " WHERE "
myqry = myqry + " itemNo = " & txtID.Text & "'"

check this code if not work please send the structure of your table with error details

This question has already been answered. Start a new discussion instead.