Sorry OuTCasT, I don't really understand what the problem is....can you try and explain it again?
Are you still using the same sql string? If not can you print the new one.
Ta muchly,
Dr B
hehe ok here goes.
I have the 4 drop down list boxes on the page.
they are not bound to the db they are static values but equal to what is in the db.
ok here is the query that im using.
- SELECT * FROM [cvinformation] WHERE (([race] = CASE WHEN @race IS NOT NULL THEN @race ELSE [race] END) AND ([province] = CASE WHEN @province IS NOT NULL THEN @province ELSE [province] END) AND ([field] = CASE WHEN @field IS NOT NULL THEN @field ELSE [field] END) AND ([gender] = CASE WHEN @gender IS NOT NULL THEN @gender ELSE [gender] END))
Ive got a page that lets users load there cv information.
and then i have a page that uses the dropdownlistboxes to search for the information and populates a gridview with that information, the gridview is selectable.
Now the problem is i have to use all 4 dropdownlist boxes in order to get the data to display.
We thought i was the dropdownlist boxes not passing " NULL " to the database.
But when i was checkin the page and searching with the dropdownlist boxes i saw that the SQL QUERY is LOOKING for NULL values in the database.....thats not wat i want.
because most users enter all criteria on the cv...
im searching for
Gender:
Field of study:
Race:
Location:
and when i was testing i saw if i entered gender, race and location it would bring up 2 names....because those name had null values as there field of study so i came to the conclusion that the query was indeed looking for null values in the database.....and when i was leaving the dropdownlists values null it was not bring back information because there is no one in the database that has null values for gender, field of study, race and location.
what i want is for example :
say i choose
Gender: Male
Field of Study: Accounting
Race: "null"
Location: Queensland
Then i want all males who do accounting and live in queensland.......but i cant seem to get that right...
another example
Gender:"null"
Field of study:"null
Race: "null"
Location:"null"
if i selected something like that then i would like ALL the records in that table to be returned into the gridview...
PLEASE HELP......lol