多个查询字符串在Showin数据中不起作用 [英] multiple query sting not working in Showin data

查看:57
本文介绍了多个查询字符串在Showin数据中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将下面代码中的按首页中的2值传递给我的目标页面

I tried to pass the 2 value from by home page in below code to my target page

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

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

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

推荐答案

您要在代码中运行的Response.Redirect.有两个?

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

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



请检查一下
您在querystring中通过了Lower吗????我不这么认为..你已经通过了
Requestor



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

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)



如果适合您,请回答.

谢谢,
Ashish



Please make it answer if it is solution for you.

Thanks,
Ashish


您错误地编写了两个重定向语句,而只需要第一个.删除第二个重定向语句将解决您的问题
you mistakenly written two redirect statement, whereas only first one is required. removing second redirect statement will resolve your problem


这篇关于多个查询字符串在Showin数据中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆