0

Please help me I got a error:Incorrect syntax near ')'. It pointed to the update_product.ExecuteNonQuery()

        Dim update_product As SqlCommand = New SqlCommand("Update sell Set Mode_Of_Payement(Cash)='" & TextBox9.Text & "',Payement='" & TextBox6.Text & "',Balance='" & TextBox8.Text & "', Mode_Of_Payement(Cheque)='" & TextBox9.Text & "',Cheque_No='" & TextBox4.Text & "' where Bill_No='" & txtbillno.Text & "'", myConnection)
        update_product.ExecuteNonQuery()
        update_product.Cancel()
2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Dili1234
1

In some fields that have parameter, are those the actual name of the field in your database? Bill_No is a number type so remove the single quotes.
Here's the sample query update.

Dim sql As String = "UPDATE sample SET one_one='" & txtone.Text & "', two_two='" & txttwo.Text & "', three_three='" & txtthree.Text & "', four_four='" & txtfour.Text & "', five_five='" & txtfive.Text & "' WHERE ID=" & _theID

0

thank you................
Can anybody explain me why this type of error coming

Attachments Capture.JPG 60.05 KB Capture.JPG 60.05 KB
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.