posted
You have two problems with this code. First off, QuantityOrdered is almost certainly an Integer field; you can't use "is like" operators on an Integer. Secondly, you're checking the QuantityOrdered column against the SelectedValue property of the ddlPr_Name field, which is probably a dropdown list of products.
My guess is that you want to sum the QuantityOrdered field across only (and all) the records that correspond to the ProductID of the item selected from the dropdown, which is the SelectedValue of ddlPr_Name.
If that's the case, what you really want is....
Okay, wait. You figure the rest out.
Posts: 37449 | Registered: May 1999
| IP: Logged |
posted
I've never considered it a rule, and certainly never let it bind me.
Posts: 37449 | Registered: May 1999
| IP: Logged |
Blayne Bradley
unregistered
posted
code:
lblTotal.Text = gt.Compute("SUM(QuantityOrdered)", "ProductName Like '" & ddlPr_Name.SelectedValue & "'")
Thanks for pointing me in the right direction.
IP: Logged |
Blayne Bradley
unregistered
posted
K, if I upload asp files to a linux server, how can I get it to work as a webpage, non homework related I just wanna put my work online so employers can look at it.
IP: Logged |
posted
Um... a Linux server is not going to be able to host asp files unless you just have static HTML content.
Posts: 3275 | Registered: May 2007
| IP: Logged |
posted
BTW, from a design perspective, you probably don't want to make ProductName the SelectedValue of your dropdownlist. The value should be the ProductID, assuming you have one.
Posts: 37449 | Registered: May 1999
| IP: Logged |