View Single Post
  #1 (permalink)  
Old December 13th, 2007, 07:21 AM
biswapinky biswapinky is offline
Registered User
 
Join Date: Dec 2007
Location: hyderabad, andhra pradesh, India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to write Store Procedure For Search

Hi..
I am working With Asp.net using Vb for a Music Project.
i have the requirment for serach songs according to catagory wise(Singer,Actor,Music Director, etc)

i have code like this...

 If Not Page.IsPostBack Then
            searchword.Text = Request.QueryString("SearchWord")
            Response.Write(Request.QueryString("SearchWord"))
            Response.Write(Request.QueryString("Language"))
            Response.Write(Request.QueryString("SelectedCatego ry"))
            'Response.Write(Request.QueryString("Query"))

            Dim str As String = "select * from Music_SongDetails where Music_Clip_Id>0 and Music_Clip_Lang='" & Request.QueryString("Language") & "'"

            If Request.QueryString("SelectedCategory") = "Song" Then
                str = str & " and Music_Clip_Name like '%" & Request.QueryString("SearchWord") & "%'"
            ElseIf Request.QueryString("SelectedCategory") = "Movie" Then
                str = str & " and Music_Folder_Name='" & Request.QueryString("SearchWord") & "'"
            ElseIf Request.QueryString("SelectedCategory") = "Actor" Then
                str = str & " and Music_Clip_Actor='" & Request.QueryString("SearchWord") & "'"
            ElseIf Request.QueryString("SelectedCategory") = "Actress" Then
                str = str & " and Music_Clip_Actress='" & Request.QueryString("SearchWord") & "'"
            ElseIf Request.QueryString("SelectedCategory") = "Music Director" Then
                str = str & " and Music_Clip_MusicDir='" & Request.QueryString("SearchWord") & "'"
            ElseIf Request.QueryString("SelectedCategory") = "Singer" Then
                str = str & " and Music_Clip_Singer='" & Request.QueryString("SearchWord") & "'"
            ElseIf Request.QueryString("SelectedCategory") = "All" Then
                str = str
            End If
...........

I need to write this code using Store Procedure....

kindly help me out....

biswa pujarini