Glen Robson

Glen Robson

  • NA
  • 46
  • 24.8k

Gridview Check against multiple rows

Feb 27 2012 5:37 AM
Hi,

I have recently been creating myself a shoping cart just to get myself to grips with ASP.NET code. Everything was going well untill i came accross an area that has my mind confused. Basically what i have is a DataView containing the following: Name, Description, Brand Gender, Quantity (this is the quantity that the user has chosen.), Date Added, Price, Product Stock (this is the amount of stock that the company has of this ietm). All of this data is being pulled from a Stored Proc.

I have checks to make sure that the user does not try to add more quantity than the stock level and this all works.

The area i am having an issue with is the confirm button, one i click the button i want all of the information in the cart (currently held in the Cart table) to be transferred to the Orders Table. Transferring the table is not a problem to me however before i do this i would like to check that the item quantity for each item in the dataview is less than or equal to the same item's stock in the Products Table. I have already checked this within the dataview if the user wants to add or delete item quantity from the Cart but how would i check every row of the cart for this as a cart can have multiple answers.

I appreciate that this can sound very confusing and if there is any more information you would like please ask.

Thanks

Boldonglen

Answers (3)