How...Search Page ????

SixString

Member
Joined
Aug 5, 2003
Messages
18
Hi ;)

Im having a problem with this kinda simple issue

I have a webform with this code :

Code:
Private Sub Submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit.Click

        Response.Redirect("~/result.aspx?Search=" + SearchBox.Text)
    End Sub
My problem is that i cant figure out how the code on the "result.aspx" can grab the Request.QueryString("Search")

What i have is something like this :
Code:
 Dim strConn As OleDb.OleDbConnection = New OleDb.OleDbConnection(ConfigurationSettings.AppSettings("MyConn"))
        Dim strSQL As String
        Dim Search As String
        Search = Request.QueryString("Search")

        strSQL = "SELECT ref FROM products WHERE ref LIKE ?"

        Dim cmd As New OleDb.OleDbCommand(strSQL, strConn)

        cmd.Parameters.Add("@ref", Search)

        strConn.Open()
        Dim rdr As OleDb.OleDbDataReader = cmd.ExecuteReader

        DataGrid1.DataSource = rdr
        DataGrid1.DataBind()
        strConn.Close()
Please someone help me whith this???

Thanks in Advance

Cheers
 
Last edited by a moderator:
Back
Top