Hi,
Can anyone advise why the following code is failing ? The code is
written in asp.net1.1 using
vb.net and connected to an access
database. The following code is taken from a function and the purpose
of this code is to check to see if an item has already been added to
the shopping cart.
The cart takes the form of a datagrid and if the item located by the
productID, already exists in the cart, then I just want the quantity
value increased by one in the datagrid. This is achieved by calling
the "IncrementCartItem" function. Otherwise the item is inserted as a
new row in the datagrid by calling the "UpdatetblCartItems" function.
I get no errors but I've tried testing the code and it seems to be
failing on the IF DataReader code. I don't think it gets as far as the
IncrementCartItem or UpdatetblCartitems functions - any ideas why,
thanks.....?
Code:
If DataReader.Read() = true
'Set datareader values
intmyCartID = dataReader("intCartID")
intmyProdID = dataReader("intProductID")
intmyQuantity = dataReader("intQuantityOrder")
'Call function to increase quantity by one if
productID already found in cart
IncrementCartItem(intmyCartID, intmyProdID,
intmyQuantity)
'Otherwise just update cart
Else
UpdatetblCartItems(Session("CartID"),Quantity,intProductID,ts)