Problem Updating Multiple Rows within a GridView

I am trying to upgrade multiple fields within a gridview  but can't seem to see what I am missing in my in my code behind.  The code on my button click is as follows:

I am trying to meet a deadline tonight and have been working on this one quirk for the last 6 hours.  Any help would be greatly appreciated.
protected void ButtonPickOrder_Click(object sender, EventArgs e)
    {
        VpaimsTableAdapters.Warehouse_LocationsTableAdapter WarehouseAdapter = new VpaimsTableAdapters.Warehouse_LocationsTableAdapter();
        string _number;
        int _pallets;
        int _cases = 0;
        int _julien;
        int _aisle = 0;
        string _location;
        
        foreach (GridViewRow  row in GridView1.Rows)
        {
            _number = Convert.ToString(GridView1.FindControl("Number"));
            _pallets = Convert.ToInt32(GridView1.FindControl("Pallets"));
            _julien = Convert.ToInt32(GridView1.FindControl("Julien"));
            _location = Convert.ToString(GridView1.FindControl("Location"));
 
            WarehouseAdapter.Update(_number, _pallets, _cases, _julien, _aisle, _location);
            GridView1.DataBind();
            
        }

Open in new window

LVL 7
imateyelectronicsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

digitalZoCommented:
Debug using a breakpoint and check at each row what's getting updated. Maybe you'll come to know what and where the problem is.
0
monarch_ilhanCommented:
instead of
_number = Convert.ToString(GridView1.FindControl("Number"));

try this
_number = Convert.ToString(row.FindControl("Number"));
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Computer101Commented:
Forced accept.

Computer101
EE Admin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.