I want to query an SQL table using some Web controls to provide the parameters for filtering the records in the table. Results are displayed in a GridView.
I have a TextBox with an ID of "keyword" where the user may enter one or more keywords. I'd like to search 2 columns for instances of these keywords.
I also have a DropDownList named "category" that lists categories contained in a "category" column of the table.
I have a dataset with a TableAdapter for the table I want to search. Got it working fine with the DropDown List but not sure how to proceed with the TextBox and keywords.
What SQL query should I use? The user may not enter anything into the textbox, they may enter one word, or multiple words.
This is where I am now:
SELECT * FROM tablename WHERE category = @category AND ?????
View Complete Post