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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.