I need to code a page to search the database for user's data. For example, the fields are
first name, last name, status, phone, DOB, type, etc.
This is how I always do a search page:
1. Create a dynamic stored proc and pass it in the "where" clause that I build in code
2. In the code, check for user's input and build the where clause. For example, I check which fields are populated and that's how I build the where clause. A lot of If statements.
That method works but I don't think it's a good way of coding it. I know SQL Server has some kind of a search (I think indexed search, not sure)
At the bottom of this site, there's an example. It loops thru the keywords. Not sure if I can use this method, somehow;
This time around, I have too many fields to use if-else statement. Is there a better way of doing this?