In my database there are 3 column which is Name, Age, Gender.
In the program, I only want to use 1 search button. When the button is clicked, the program determine which 3 of the textbox has input and search for the right data.
How do you work with the query? For example if Name and Gender has text, the query :
Select * from table Where (Name = @name) AND (Gender = @gender)
Select * from table Where (Name = @name OR @name is Null) AND (Gender = @gender OR @gender is Null) ...
it should be one query