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

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.

just change this line of code

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

Regards

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

Edited 4 Years Ago by G_Waddell

•̸ŤђαϞĸ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.