How write a store procedure for multiple values selected by dropdown list or asp.net control from as

Posted by Cpatil1000 under ASP.NET on 10/14/2013 | Points: 10 | Views : 1763 | Status : [Member] | Replies : 1
Hi
I am making a form for search report or display status of information from database and this report is binding to Datagrid.
I have eight to ten dropdown list box and 4 to 5 have checkbox and radion button also. When I selected some them my parameter must go to sql queries and output I want display into datagrid. I am trying to such type of form. But I am getting confused how developed such type of form. All output must be display into datagrid. With following features..
1) Compare to values
2) Greater than or less than
3) Sometime compare year
4) Sometime compare with district or city name
5) Compare district with year and values greater than or less than
6) Compare villages or Gram Panchayat with year and values greater than or less than
7) And so on…..
Please suggest how develop such type of form and how pass a parameter to store procedure, because some parameter will pass value or some of parameter pass a null values also
Any there site or website such type form are using and developed by them so I can use them or type to make such type of form.
I will appreciate if help me. It is very urgent...




Responses

Posted by: Bandi on: 10/15/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
>>how pass a parameter to store procedure, because some parameter will pass value or some of parameter pass a null values also

CREATE PROCEDURE USP_Search
( @P_Year INT
)
AS
SELECT * FROM TableName WHERE ( YearColumn = @P_Year OR @P_Year IS NULL )


the following condition will check for either given value or retrieves all records in the case of parameter(@P_Year) is NULL...
WHERE ( YearColumn = @P_Year OR @P_Year IS NULL )

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Cpatil1000, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response