Dynamically add the checkboxlist checked value of asp.ne/C# in a stored procedure of sql server 2008
Posted on 2012-03-24
I am using Asp.net/C# 3 tiers Architecture, i have 3 checkboxlists and there are several checkboxes in each checkboxlist, im sending the parameters of every checked checkbox value to sqlserver 2008 as a parameter and then include it in the select statement.
the problem i have is im sending all checkboxes as a parameter and then in sql server stored procedure im checking with if statement that if this is not empty then include it in the select statement so for this i have included a lot of if statements,
my question is that is there any way to build a dynamically sql server stored procdeure which check the parameters that if it is not empty then it include it in the select statement otherwise ignore it.
any help will be appreciated.