Please Scroll Down to See Forums Below
napsgear
genezapharmateuticals
domestic-supply
puritysourcelabs
UGL OZ
UGFREAK
napsgeargenezapharmateuticals domestic-supplypuritysourcelabsUGL OZUGFREAK

Anyone into ASP.NET ?

I have a question:

I am doing a search page using the GET method and a list/menu.
In the list/menu i have the categories. EX:. cat1; value = 1 / cat2; value =2 etc .
I want to have an "All categories", but i don't know what value to give to it, so the result page would give me "all categories".

This is the SQL statement in the results page:

SELECT *
FROM Qryresults
WHERE category_ID = ?
ORDER BY produts_ID ASC

parameter: @category_ID
Type: integer
Value: IIf((Request.QueryString("form1") <> Nothing), Request.QueryString("form1"), "")

.......

I am using dreamweaver...everything works fine except for the "ALL categories" wich i don't know how to make it work...

THanks
 
hmmm.....

(I am using VBscript, don't really know if it really matters)

I know how to solve this in ASP VBscript.
In the database i don't have any value for "ALL", for having "ALL" it works by giving the value % to ALL and then in the SQL :
SELECT *
WHERE category_ID LIKE 'form1'

.....

Not sure if i am explaining this well

Anyway thank you supernav :)
 
dim sql1


if Request.QueryString("form1") <> nothing
sql1 = "SELECT *"
sql1 = sql1 & "FROM Qryresults"
sql1 = sql1 & "WHERE category_ID = ?"
sql1 = sql1 & Request.QueryString("form1")
else
sql1 = "SELECT *"
sql1 = sql1 & "FROM Qryresults"
 
Top Bottom