Originally posted by OuTCasT
IS Null
Collapse
X
-
I think this issue is related to front end part, where you need to select atleast NULL for the other two list box if you dont want to select any other value. Do you have a page with submit button or something, which you click after selecting a value form the three list boxes? -
Originally posted by amitpatel66I think this issue is related to front end part, where you need to select atleast NULL for the other two list box if you dont want to select any other value. Do you have a page with submit button or something, which you click after selecting a value form the three list boxes?
yes i have a button that i click to submit.
in the 3 dropdownboxes i used static values equal to the database instead of binding them.
the first listitem in each is
<asp:ListItem ></asp:ListItem>
maybe its the null value that is not going through for the other selections.Comment
-
NULL is not equal to 'Does not exist'Originally posted by OuTCasTyes i have a button that i click to submit.
in the 3 dropdownboxes i used static values equal to the database instead of binding them.
the first listitem in each is
<asp:ListItem ></asp:ListItem>
maybe its the null value that is not going through for the other selections.
Set the DEFAULT for all the three list boxes to NULL and then test. Check if it works that way?Comment
-
If that is the case then why dont you CODE it on click of submit button. You can set the three variable values to NULL in your source code. Then on click of submit button, if you do not select any value from any of the list box, then the corresponding variable will be NULL. So This way NULL will be passed to the Query.Originally posted by OuTCasTno default setting in the propertiesComment
-
This query that u helped me out withOriginally posted by amitpatel66If that is the case then why dont you CODE it on click of submit button. You can set the three variable values to NULL in your source code. Then on click of submit button, if you do not select any value from any of the list box, then the corresponding variable will be NULL. So This way NULL will be passed to the Query.
[CODE=sql]SELECT [title], [gender], [initials], [name], [surname], [birthdate], [postaladdress], [suburb], [city], [zipcode], [criminalrecord], [drivers], [maritalstatus], [dependants], [citizenship], [province], [contactref], [hometel], [cell], [jobtitle], [relocate], [emmigrate], [email], [worktel], [enddate], [startdate], [FIELD], [education], [company], [positionheld], [jobdescription], [contactperson], [contacttel], [startdate2], [contactperson3], [jobdescription3], [positionheld3], [company3], [enddate3], [startdate3], [contacttel3], [other] 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 ([education] = CASE WHEN @education IS NOT NULL THEN @education ELSE [education] END))[/CODE]
I found the problem, it looks for NULL values in the db...and most of the rows have not got any null values...so no data was being returnd.
What i want is to leave them blank and not search the database for the NULL values just for the values that are selected ..???/
so if i did leave like 2 selections out it would still give me the data...Comment
-
Can you check what is the value being passed for all the three parameters. After selecting the values from all the three listboxes, pint the variables to see what value it holds, and if you do not pass a value does it hold word 'NULL' or nothing??Comment
-
The selections are searching for NULL if nothing is selectedOriginally posted by amitpatel66Can you check what is the value being passed for all the three parameters. After selecting the values from all the three listboxes, pint the variables to see what value it holds, and if you do not pass a value does it hold word 'NULL' or nothing??
but for those selections like
Gender:
Race:
Field of study:
Location:
when the user saves this information its not null, he insert information and what your query does is search those fields for null values...then it brings nothing back because there are no null values in those fields
What i want is even though i leave certain selection null and only choose the other 2 selections to bring back those ppl information ....is that possible ?Comment
Comment