Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I tried to pass the 2 value from by home page in below code to my target page

C#
Response.Redirect("editclass.aspx?Requestor=" &
       TextBox1.Text & "&Lower= " & lblAllocation.Text)
        Response.Redirect("editclass.aspx?" + TextBox1.Text)


on target page i retrived my values like below
C#
lblejamaatidrequest.Text = Request.QueryString("Requestor")
lblAllocation.Text = Request.QueryString("Lower")


both has worked fine but when i tried to search my data using below commands i get nothing what i have done wrong

VB
Dim Conn As OleDbConnection
        Conn = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;" & _
                                     "Data Source=d:\student2003.mdb")
        Conn.Open()

        Dim DataReader As OleDbDataReader
        Dim Command As OleDbCommand

        Command = New OleDbCommand("SELECT Student_Details.[EJamaatID], Student_Details.[FullName], Student_Details.[Sex], Student_Details.[Age], Student_Details.[Email], Student_Details.[Mobile],  Student_Details.[Allocation] FROM Student_Details WHERE   Allocation=@Allocation And EJamaatID=@EJamaatID", Conn)

        Command.Parameters.Add(New OleDbParameter("@Allocation", lblAllocation.Text))
        Command.Parameters.Add(New OleDbParameter("@EJamaatID", TextBox3.Text))
        Try
            DataReader = Command.ExecuteReader()
            GridView1.DataSource = DataReader
            GridView1.DataBind()
            GridView1.Visible = True

        Catch ex As Exception
            MsgBox(Err)
        End Try
        Conn.Close()


please help on
Posted
Updated 1-Jul-12 7:01am
v5
Comments
[no name] 30-Jun-12 23:03pm    
What does "i get nothing" mean? The query does not return any data? You do not see any thing in the grid? The reader is empty? You cannot connect to the database? You get an error? Why do you use lblejamaatidrequest.Text for your quesy string but in your query you use TextBox3.Text?
Sandeep Mewara 1-Jul-12 4:32am    
Your code snippet is no where related to Query string that you started your question with. Please elaborate.
Ganesan Senthilvel 1-Jul-12 13:01pm    
Code format
DamithSL 1-Jul-12 13:09pm    
what is TextBox3.Text? you have not used lblejamaatidrequest.Text in your parameters? is that what you expected?
Shemeer NS 1-Jul-12 13:45pm    
you mistakenly written two redirect statement, whereas only first one is required and that will resolve your problem

Which Response.Redirect you are trying to run in your code.There are two??

VB
Response.Redirect("editclass.aspx?Requestor=" &
       TextBox1.Text & "&Lower= " & lblAllocation.Text)
        Response.Redirect("editclass.aspx?" + TextBox1.Text)


please, Check it out
Have you passed Lower in your querystring??? i didn't think so.. you have passed
only Requestor

VB
Response.Redirect("editclass.aspx?Requestor=" &TextBox1.Text & "&Lower= " & lblAllocation.Text)
   
Check this code of line where you are redirecting your page with only one parameter that is <code>requestor</code>.

Response.Redirect("editclass.aspx?" + TextBox1.Text)


Please make it answer if it is solution for you.

Thanks,
Ashish
 
Share this answer
 
you mistakenly written two redirect statement, whereas only first one is required. removing second redirect statement will resolve your problem
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900