0

please help me check this sql statement. it is giving me this error "No value given for one or more required parameters. "

    cn.Open()
    Dim cmd As New OleDb.OleDbCommand
    cmd.Connection = cn
    cmd.CommandType = CommandType.Text
    cmd.CommandText = "Update HallTransaction Set status=? where ID=?"

    cmd.Parameters.Add("@statu", OleDb.OleDbType.VarChar).Value = check
    cmd.Parameters.Add("@Custid", OleDb.OleDbType.VarChar).Value = txtcustid.Text

    cmd.executeNonQuery

thanks

5
Contributors
7
Replies
8
Views
4 Years
Discussion Span
Last Post by M.Waqas Aslam
0

Try setting the command to this string first

cmd.CommandText = "Update HallTransaction Set status=@statu where ID=@custid"

and don't forget to put single quotes around text fields.

0

just change this line of code

cmd.CommandText = "Update HallTransaction Set status=@status where ID=@ID"

Regards

0

Isn't that what the good reverend sugguested about 9 hours before you?

Edited by G_Waddell

0

•̸ŤђαϞĸs so much I can see where am making the error. It is at the field name. I can't believe I can make this error. •̸ŤђαϞĸs so much , I really appreciate your contribution. This is my first time θƒ using this forum. It has really help. Thanks

This question has already been answered. 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.