akrashdi
04-15-2007, 09:53 PM
Hi,
I have an ASP shopping cart page which has following function to provide a list of the products. How can I connect it to the database so that it pulls all these rows from the database.
' We implemented this this way so if you attach it to a database you'd only need one call per item
Function GetItemParameters(iItemID)
Dim aParameters ' Will contain 3 string values : image path, description, price
' However we need to keep price so it can be converted to a
' single for computation hence no currency symbol. This array
' can also be expanded to contain any other information about the
' product that you might want to pull from the DB.
Select Case iItemID
Case 1
aParameters = Array("./images/shop_shirt.gif", "ASP 101 T-Shirt", "15.00")
Case 2
aParameters = Array("./images/shop_kite.gif", "ASP 101 Kite", "17.50")
Case 3
aParameters = Array("./images/shop_watch.gif", "ASP 101 Watch", "35.00")
Case 4 ' Not in use because we couldn't draw a pen in a few seconds!
aParameters = Array("./images/shop_pen.gif", "ASP 101 Pen", "5.00")
End Select
' Return array containing product info.
GetItemParameters = aParameters
End Function
%>
I have an ASP shopping cart page which has following function to provide a list of the products. How can I connect it to the database so that it pulls all these rows from the database.
' We implemented this this way so if you attach it to a database you'd only need one call per item
Function GetItemParameters(iItemID)
Dim aParameters ' Will contain 3 string values : image path, description, price
' However we need to keep price so it can be converted to a
' single for computation hence no currency symbol. This array
' can also be expanded to contain any other information about the
' product that you might want to pull from the DB.
Select Case iItemID
Case 1
aParameters = Array("./images/shop_shirt.gif", "ASP 101 T-Shirt", "15.00")
Case 2
aParameters = Array("./images/shop_kite.gif", "ASP 101 Kite", "17.50")
Case 3
aParameters = Array("./images/shop_watch.gif", "ASP 101 Watch", "35.00")
Case 4 ' Not in use because we couldn't draw a pen in a few seconds!
aParameters = Array("./images/shop_pen.gif", "ASP 101 Pen", "5.00")
End Select
' Return array containing product info.
GetItemParameters = aParameters
End Function
%>