Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6114307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:57:34+00:00 2026-05-23T14:57:34+00:00

I am trying to update my table. I have a page with just one

  • 0

I am trying to update my table. I have a page with just one TextBox where the user can enter a quantity, but it just doesn’t update. There’s no errors or anything. And, let’s just say that there was already ‘1’ in the column, and then I update it to say, ‘6’, then I go back to the table, that particular row has now become ‘0’. I don’t get it.

When I look at the Query String part of the url.. No matter what value I post ufing the form, it always says 0 is the query string.

Here’s what I’ve got:

    var UpdateQuantityQuery = "";
    if(Request.Form["IsBoxed"].AsBool() == true)
    {
        UpdateQuantityQuery = "UPDATE Cart SET Boxes = '" + Request.Form["quantity"].AsInt() + "' WHERE PartNumber = '" + Request.Form["PartNumber"] + "' AND IsBoxed = 'True' AND OrderId = '" + Session["OSFOID"] + "'";
        database.Execute(UpdateQuantityQuery);

        // Redirect back to their SHopping Cart now.
        Response.Redirect("~/Account/Cart.cshtml");
    }
    else
    {
        UpdateQuantityQuery = "UPDATE Cart SET Units = '" + Request.Form["quantity"].AsInt() + "' WHERE PartNumber = '" + Request.Form["PartNumber"] + "' AND IsBoxed = 'False' AND OrderId = '" + Session["OSFOID"] + "'";
        database.Execute(UpdateQuantityQuery);

        // Redirect back to their SHopping Cart now.
        Response.Redirect("~/Account/Cart.cshtml");
    }

And the form code is:

<form method="post" action="EditQuantity.cshtml?Update=OK&PartNumber=@Request["PartNumber"]&IsBoxed=@Request["IsBoxed"]">
    <fieldset>
        <legend>Edit Quantity</legend>
        <label for="quantity">
                @Message
        </label>
        <input type="text" name="quantity" title="Edit Quantity" />
        <input type="submit" value="Confirm" title="Confirm Change" />
    </fieldset>
</form>

Am I doing something wrong here that could be causing this to cojombulate?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:57:35+00:00Added an answer on May 23, 2026 at 2:57 pm

    You should use

    if(Request.QueryString["IsBoxed"].AsBool() == true)
    

    not form, you are sending this info through query string not as form element

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to update a table in MySQL 5.0 with Coldfusion MX
I'm trying to update a table from a form. I have 3 pages. The
I have a heap based table in MySQL that I am trying to update
I'm trying to update one table based on values in another table. What's wrong
I am trying to update table A with data from table B. I thought
Im trying to update a table with the following code. If I change WHERE
I am trying to update a table and I am only given a varchar
I'm trying to update a table in my DynamoDB tables using the PHP SDK.
I am trying to update a table according to this trigger: CREATE TRIGGER alert
I'm trying to better understand why one of our database update scripts failed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.