Hi,
I have a form that has collection of drop down lists , text boxes and search button.When i select any one of dropdown list or textbox and click on search,
it should be queried based on the single parameter passed and taking other values as null.I am not getting the logic in implementation of Stored Procedure,Can u please help me with that?Thanks in Advance.
Regards,
Sivapratap
Jignesh TrivediPosted Apr 14, 2014, 3:40 AM
hi,
I think, In this case you can use Optional parameter in SQL stored procedure.
Please refer below link for mare detail
http://weblogs.asp.net/stanleygu/archive/2010/02/08/solution-5-implementing-optional-parameters-in-t-sql-stored-procedures.aspx
hope this will help you.
sivapratap KurapatiPosted Apr 14, 2014, 11:23 AM
sivapratap KurapatiPosted Apr 14, 2014, 3:31 AM
Posted Apr 11, 2014, 8:32 AM
kindly pass DbNull.Value value to the parameter those you want to pass null, the sql parameters is not accepting .net's null value so you have to pass DbNull.Value
Example:
SqlParameter sp=new SqlParameter();
Sp.Value=DbNull.Value;
Kindly accept as answer, if it helps you