I want to implement searching dynamically,
for eg. I have 5 controls c1 is textbox, c2 is dropdownlists and c3,c4,c5 are dates
basic query is select * from abc
if there is data in c1 then add it to query’s where clause, else leave.
if there is data in c2 then add it to query’s where clause, else leave.
if there is data in c3 then add it to query’s where clause, else leave.
if there is data in c4 and c5 then add it to query’s where clause as date between c4 and c5, else leave.
User can give any value from c1 to c5 thus according to that i want to build query (i have to build proper where clause)
How do i perform it in SQL-server.