Hmm, not sure, but a few things do jump out at me even if they are not causing
your problem:
1) You have 2 extra space in your redirect line. Use this:
Response.Redirect("Lab12A.aspx?auId=" & userInput & "&theInput=" & userInput)
2) You are redirecting with 2 values passed in your querystring (auId &
theInput). However, in page 2, you are retreiving only 1 of the 2 of them. Is
this correct or should you be getting both?
Dim theInput As String = Request.QueryString("auId")
Dim myInput As String = Request.QueryString("auId")
3) Put the following in page 2 right after your line "SqlStm = "select
au_lname, au_fname, titles.title_id, ......" :
Response.Write("<BR>SQL = " & SqlStm)
Response.End
This will write your exact sql statement to the screen. Make sure that your
SQL statement is correct. You can check this by running it as a query in
Access.
4) You do not have the table name preceding the first 2 column names in your
sql statement. Add them.
Mark
icedaviance <[EMAIL PROTECTED]> wrote:
This is for the 1st page... I'm gathering the information fine but
on the 2nd page is where I am having the problem
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
Dim myConn As OleDb.OleDbConnection
Dim myCommand As OleDb.OleDbCommand
Dim myDataAdapter As OleDb.OleDbDataAdapter
Dim myData As DataSet
Dim connString, SqlStm As String
Dim theGrid As DataGrid
myConn = New OleDb.OleDbConnection()
myCommand = New OleDb.OleDbCommand()
myDataAdapter = New OleDb.OleDbDataAdapter()
myData = New DataSet()
connString = "Provider=Microsoft.jet.oledb.4.0;" & _
"data Source=c:\cis285Night\bookbizN.mdb"
myConn.ConnectionString() = connString
SqlStm = "select authors.au_lname, authors.au_fname,
titles.title_id, titles.title from authors, titles, titleauthors "
myDataAdapter.SelectCommand = New OleDb.OleDbCommand
(SqlStm, myConn)
myDataAdapter.SelectCommand.Connection.Open()
myDataAdapter.Fill(myData, "Authors")
DataGrid1.DataSource = myData.Tables("Authors")
Page.DataBind()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim userInput As String = tfInput.Text
Response.Redirect("Lab12A.aspx?auId=" & userInput & " &
theInput= " & userInput)
End Sub
Private Sub tfInput_TextChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles tfInput.TextChanged
End Sub
End Class
2nd page where I'm having the problem
If Not IsPostBack Then
Dim myConn As OleDb.OleDbConnection
Dim myCommand As OleDb.OleDbCommand
Dim myDataAdapter As OleDb.OleDbDataAdapter
Dim myData As DataSet
Dim connString, SqlStm As String
Dim theGrid As DataGrid
Dim theInput As String = Request.QueryString("auId")
Dim myInput As String = Request.QueryString("auId")
myConn = New OleDb.OleDbConnection()
myCommand = New OleDb.OleDbCommand()
myDataAdapter = New OleDb.OleDbDataAdapter()
myData = New DataSet()
connString = "Provider=Microsoft.jet.oledb.4.0;" & _
"data Source=c:\cis285Night\bookbizN.mdb"
myConn.ConnectionString() = connString
SqlStm = "select au_lname, au_fname, titles.title_id,
titles.title from authors, titles, titleauthors where authors.au_id =
titleauthor.au_id AND titles.title_id = titleauthors.title_id AND
authors.au_lname LIKE '" & theInput & "%' AND titles.title LIKE '" &
myInput & "%' ORDER BY authors.au_lname, authors.au_fname"
myDataAdapter.SelectCommand = New OleDb.OleDbCommand
(SqlStm, myConn)
myDataAdapter.SelectCommand.Connection.Open()
myDataAdapter.Fill(myData, "Authors")
DataGrid1.DataSource = myData.Tables("Authors")
Page.DataBind()
End If
End Sub
End Class
--- In [email protected], Mark E
<[EMAIL PROTECTED]> wrote:
> Post your code so that we can see it.
>
> Mark
> --- icedaviance <[EMAIL PROTECTED]> wrote:
> > Hi All:
> >
> > I'm new to ASP.NET. I'm working on a project where
> > I'm trying to send
> > a query result to another page. Working with a
> > database where the user
> > will enter the author or title & with their response
> > the information
> > will be displayed on the next page. Problem my
> > query isn't working
> > properly. I believe it's the concatenation of the
> > where clause.
> >
> > Both text fields are named but I'm still getting an
> > error. What would
> > be the syntax that you use when your working with
> > queries & asp.net
> > capturing more than one user input?
> >
> > Thanks
> > Aviance
> >
> >
> >
> >
> >
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/