passing parameter between asp.net pages

lis

Newcomer
Joined
Jan 24, 2005
Messages
4
Hi All,

I have a search page which searches for usernames. I want to use the same for searching product names, asset names, etc. I want to globalize. Is this possible? IF so how I can I do it?

Thanks And regards,
lis
 
Hi SteveoAtilla,

Thank you replying. I know what a session and application variable are but how can I make it to use here. Would you please give me some guidance?

I placed my connection string in the Global.Asax file like
Application("connection")="data source=localhost;initial catalog=Lookup;integrated security=true"

And i couldn't get the connection to open up it is giving me CAST NOT SPECIFIED error.

How can I declare the tables and fields in the same file?


Thanks and regards,
lis
 
Last edited:
This is my code:

Code:
 Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        Dim str As String = TextBox1.Text & "%"
        Dim Connection As String = Application("connection")
        Dim Connection1 As New SqlConnection(Connection)
        Dim t As String = Application("dbopen")
        Dim f As String = Application("Field")
        Dim cmdGetRec As New SqlCommand("SELECT '" & f & "' FROM '" & t & "' WHERE '" & f & "' LIKE '" & str & "'", Connection1)
        Dim drGetRec As SqlDataReader
        Connection1.Open()
        drGetRec = cmdGetRec.ExecuteReader()
        ListBox1.DataSource = drGetRec
        ListBox1.DataTextField = "f"
        ListBox1.DataBind()

    End Sub

On my global.asax file I have the following code:

Code:
Application("connection") = "data source=lis;initial catalog=Lookup;integrated security=SSPI;persist security info=True;workstation id=lis;packet size=4096"
        Application("dbopen") = "main"
        Application("Field") = "UserName"

I don't know if my declarations r right, Im just a newbie.

Thanks and regards.
lis
 
PlausiblyDamp Thank you for your concern, I got it done. But now I have another prob. I am using a listbox to Populate the name's in the search.aspx page. What I am facing now is that I when I select a name in the listbox I don't seem to get it on the textBox in the main.aspx.
Can you tell me how I should go about with this one?

Thanks and regards,
lis
 
Back
Top