Newbie:please help me 'display' this on a simple .aspx page

Discussion in 'ASP .Net' started by Marlon Brown, Mar 11, 2005.

  1. Marlon Brown

    Marlon Brown Guest

    I understand that store procedures are the recommended way to handle SQL
    queries from an ASP application. However I am working on a small academic
    assignment and I just need to get this over with. I created the store
    procedure but now the teacher didn't accept that, as he is concerned he
    would need to install the store procedure in Query Analyzer from his end.
    Can you please clarify how I would be to do the following using a Select
    Statement (VB.NET, ASP.NET 2.0):



    Dim myNextPage
    myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.

    Dim myString
    myString = "SELECT Employee From Pubs " _
    & "WHERE job_id = " & TxtBox1.Text And
    & "WHERE employee_name = " & TxtBox2.Text And
    & "WHERE hire_date = " & TxtBox3.Text

    'Now I want to:
    If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
    (hire_date = TxtBox3.Text) Then
    Response.Redirect("myNextPage")
    'Then on Next page I would like to display label.Text = "Your
    information matched and I can go ahead to reset your password in AD..."
    'However doing:
    label.Text = "Your info matched and I can go ahead and reset your
    password in AD..." ' This wouldn't work. Where do I need to put this
    Label.Text ="..." ?

    Else
    Response.Redirect("myNextPage")
    'Display on next page Label.Text = "The phrase(s) you typed didn't
    match. Please click back button and resubmit info."
    'If possible, I would like to display all phrases that did not match
    in 'myNextPage', so that user would know which ones he didn't answer
    correctly.

    End If

    End Sub
     
    Marlon Brown, Mar 11, 2005
    #1
    1. Advertising

  2. In that case u may choose to write all logic of stored procedure in asp.net
    itsself.

    -jignesh
    www.dotnetjini.com

    "Marlon Brown" <> wrote in message
    news:...
    > I understand that store procedures are the recommended way to handle SQL
    > queries from an ASP application. However I am working on a small academic
    > assignment and I just need to get this over with. I created the store
    > procedure but now the teacher didn't accept that, as he is concerned he
    > would need to install the store procedure in Query Analyzer from his end.
    > Can you please clarify how I would be to do the following using a Select
    > Statement (VB.NET, ASP.NET 2.0):
    >
    >
    >
    > Dim myNextPage
    > myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
    >
    > Dim myString
    > myString = "SELECT Employee From Pubs " _
    > & "WHERE job_id = " & TxtBox1.Text And
    > & "WHERE employee_name = " & TxtBox2.Text And
    > & "WHERE hire_date = " & TxtBox3.Text
    >
    > 'Now I want to:
    > If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
    > (hire_date = TxtBox3.Text) Then
    > Response.Redirect("myNextPage")
    > 'Then on Next page I would like to display label.Text = "Your
    > information matched and I can go ahead to reset your password in AD..."
    > 'However doing:
    > label.Text = "Your info matched and I can go ahead and reset your
    > password in AD..." ' This wouldn't work. Where do I need to put this
    > Label.Text ="..." ?
    >
    > Else
    > Response.Redirect("myNextPage")
    > 'Display on next page Label.Text = "The phrase(s) you typed didn't
    > match. Please click back button and resubmit info."
    > 'If possible, I would like to display all phrases that did not match
    > in 'myNextPage', so that user would know which ones he didn't answer
    > correctly.
    >
    > End If
    >
    > End Sub
    >
    >
     
    Jignesh Desai, Mar 11, 2005
    #2
    1. Advertising

  3. Marlon Brown

    Marlon Brown Guest

    Ok, if you can't show me the SQL part OK, but could you help me with on how
    to display whatever variable I capture from the SQL query on .ASP.NET ?
    I tried to use Response.Write(TextBox1.Text) but that didn't returned
    satisfactory results. I understand I shouldn't use Response.Write and
    therefore I attempted to create a Label1.Text to display whatever
    information I got from SQL. The problem is that I do Label1.Text =
    InfoFromSQL and that doesn't work either. It returns nothing on the
    Label1.Text.

    'Then on Next page I would like to display label.Text = "Your
    'information matched and I can go ahead to reset your password in AD..."
    ' 'However doing:
    ' label.Text = "Your info matched and I can go ahead and reset your
    ' password in AD..." ' This wouldn't work. Where do I need to put this
    ' Label.Text ="..." ?


    I am trying to
    "Jignesh Desai" <> wrote in message
    news:O8z%...
    > In that case u may choose to write all logic of stored procedure in
    > asp.net
    > itsself.
    >
    > -jignesh
    > www.dotnetjini.com
    >
    > "Marlon Brown" <> wrote in message
    > news:...
    >> I understand that store procedures are the recommended way to handle SQL
    >> queries from an ASP application. However I am working on a small academic
    >> assignment and I just need to get this over with. I created the store
    >> procedure but now the teacher didn't accept that, as he is concerned he
    >> would need to install the store procedure in Query Analyzer from his end.
    >> Can you please clarify how I would be to do the following using a Select
    >> Statement (VB.NET, ASP.NET 2.0):
    >>
    >>
    >>
    >> Dim myNextPage
    >> myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
    >>
    >> Dim myString
    >> myString = "SELECT Employee From Pubs " _
    >> & "WHERE job_id = " & TxtBox1.Text And
    >> & "WHERE employee_name = " & TxtBox2.Text
    >> And
    >> & "WHERE hire_date = " & TxtBox3.Text
    >>
    >> 'Now I want to:
    >> If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
    >> (hire_date = TxtBox3.Text) Then
    >> Response.Redirect("myNextPage")
    >> 'Then on Next page I would like to display label.Text = "Your
    >> information matched and I can go ahead to reset your password in AD..."
    >> 'However doing:
    >> label.Text = "Your info matched and I can go ahead and reset your
    >> password in AD..." ' This wouldn't work. Where do I need to put this
    >> Label.Text ="..." ?
    >>
    >> Else
    >> Response.Redirect("myNextPage")
    >> 'Display on next page Label.Text = "The phrase(s) you typed didn't
    >> match. Please click back button and resubmit info."
    >> 'If possible, I would like to display all phrases that did not
    >> match
    >> in 'myNextPage', so that user would know which ones he didn't answer
    >> correctly.
    >>
    >> End If
    >>
    >> End Sub
    >>
    >>

    >
    >
     
    Marlon Brown, Mar 11, 2005
    #3
  4. Labels do not produce actual HTML control on the client-side so have no way
    to postback to the server. I believe you can store you texts in Session
    variable.

    Session["yourmsg"] = "Your info matched and I can go ahead and reset your
    password in AD..."

    Then in the other page:
    label.Text = CStr(Session["yourmsg"])

    You may use Session variable to store anything, including ArrayList and
    access it on other pages in the same session. Just rememeber to CType it
    back when you retrieve it.

    "Marlon Brown" <> ¦b¶l¥ó
    news: ¤¤¼¶¼g...
    > I understand that store procedures are the recommended way to handle SQL
    > queries from an ASP application. However I am working on a small academic
    > assignment and I just need to get this over with. I created the store
    > procedure but now the teacher didn't accept that, as he is concerned he
    > would need to install the store procedure in Query Analyzer from his end.
    > Can you please clarify how I would be to do the following using a Select
    > Statement (VB.NET, ASP.NET 2.0):
    >
    >
    >
    > Dim myNextPage
    > myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
    >
    > Dim myString
    > myString = "SELECT Employee From Pubs " _
    > & "WHERE job_id = " & TxtBox1.Text And
    > & "WHERE employee_name = " & TxtBox2.Text And
    > & "WHERE hire_date = " & TxtBox3.Text
    >
    > 'Now I want to:
    > If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
    > (hire_date = TxtBox3.Text) Then
    > Response.Redirect("myNextPage")
    > 'Then on Next page I would like to display label.Text = "Your
    > information matched and I can go ahead to reset your password in AD..."
    > 'However doing:
    > label.Text = "Your info matched and I can go ahead and reset your
    > password in AD..." ' This wouldn't work. Where do I need to put this
    > Label.Text ="..." ?
    >
    > Else
    > Response.Redirect("myNextPage")
    > 'Display on next page Label.Text = "The phrase(s) you typed didn't
    > match. Please click back button and resubmit info."
    > 'If possible, I would like to display all phrases that did not match
    > in 'myNextPage', so that user would know which ones he didn't answer
    > correctly.
    >
    > End If
    >
    > End Sub
    >
    >
     
    Lau Lei Cheong, Mar 11, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,026
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,202
    Matt Morris
    Jan 23, 2004
  3. John M
    Replies:
    1
    Views:
    1,257
    Kumar Reddi
    May 29, 2005
  4. Progman
    Replies:
    2
    Views:
    1,939
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 13, 2006
  5. KK
    Replies:
    2
    Views:
    664
    Big Brian
    Oct 14, 2003
Loading...

Share This Page