good morning,
i have created a winform that search with multiple criteria , and each criteria has a checkbox to decide to u choose this criteria or not.
my question is how to write the query??? so that it works fine if one checkbox is selected or 2 or more.
thanks
Loading
sara lionPosted Dec 28, 2011, 1:00 PM
hi mamta ,
i know my solution is not professional , below are my codes ,thanks a lot .
using (SqlConnection cn = new SqlConnection(Common.ConnectionString))
Mamta MPosted Dec 28, 2011, 1:25 AM
Can you show what code you are using so far?
-Mamta
sara lionPosted Dec 28, 2011, 1:16 AM
i did many if s ans select queries ,which works but not always .:(
Mamta MPosted Dec 26, 2011, 6:20 AM
Consider an example.
Assuming that you want to search for all candidates having qualification as MCA, or name containing Nicole, or a id less than or equal to 100, you can write the query as below:
SELECT candidateId, Name, Address, qualification
FROM Candidates where qualification='MCA' OR Name LIKE 'Nicole%' OR candidateId<=100