Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 11th, 2006, 06:29 AM
Authorized User
 
Join Date: Sep 2006
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Default Checkout Problem

Hi,

 I keep getting the error "No value given for one or more required parameters." when trying to update the quantity field in my checkout page. I have designed the page to identify the product via the cartitemID and created a text box to allow the customer to manually change the quantity field of each item. Code is below which is written in asp.net 1.1 with vb2003 :



 Sub dgCart_Update(sender As Object, e As DataGridCommandEventArgs)

        Dim strConnString As String = ConfigurationSettings.AppSettings.Get("ConnectionS tring")
        strConnString = String.Format(strConnString, Server.MapPath("\db\nwguitars.mdb"))
        Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(strConnString)

        Dim intCartitemID As Integer
        Dim txtQuantity As TextBox
        Dim intQuantity As Integer

        intCartitemID = dgCart.DataKeys(e.Item.ItemIndex)
        txtQuantity = e.Item.FindControl("txtQuantity")
        intQuantity = txtQuantity.Text

        Dim strSQL As String = "UPDATE [tblCartItems] SET [intQuantityOrder]=@Quantity WHERE "& _
        "intCartitemID = @intCartitemID"

        Dim dbCommand As New OleDbCommand(strSQL, dbConnection)

        Dim cmd As New OleDbCommand

        With cmd.Parameters:
            .Add(New OleDbParameter("@Quantity", intQuantity))
            .Add(New OleDbParameter("@intCartitemID", intCartitemID))
        End With

        dbConnection.Open()
        dbCommand.ExecuteNonQuery()
        dbConnection.Close()

        dgCart.EditItemIndex = -1
        dgCart.DataBind()

    End Sub

Thanks






Similar Threads
Thread Thread Starter Forum Replies Last Post
TBH integration with Google Checkout? deasoft BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 November 4th, 2008 01:05 PM
C# Chap13, Checkout (Last Exercise) onlinecg BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 February 20th, 2008 05:49 AM
Error in checkout fase paolo70 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 2 September 10th, 2007 09:03 AM
Chapter 8: checkout process mbeppe BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 4 August 10th, 2007 07:59 AM
Checkout Issue rsm42 ASP.NET 1.0 and 1.1 Basics 4 November 27th, 2006 03:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.