Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi ;)

 

Im having a problem with this kinda simple issue

 

I have a webform with this 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 :

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

Edited by Robby

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...