Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Newbie:please help me 'display' this on a simple .aspx page

Reply
Thread Tools

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

 
 
Marlon Brown
Guest
Posts: n/a
 
      03-11-2005
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


 
Reply With Quote
 
 
 
 
Jignesh Desai
Guest
Posts: n/a
 
      03-11-2005
In that case u may choose to write all logic of stored procedure in asp.net
itsself.

-jignesh
www.dotnetjini.com

"Marlon Brown" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Marlon Brown
Guest
Posts: n/a
 
      03-11-2005
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" <(E-Mail Removed)> wrote in message
news:O8z%(E-Mail Removed)...
> In that case u may choose to write all logic of stored procedure in
> asp.net
> itsself.
>
> -jignesh
> www.dotnetjini.com
>
> "Marlon Brown" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
Lau Lei Cheong
Guest
Posts: n/a
 
      03-11-2005
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" <(E-Mail Removed)> bl
news:(E-Mail Removed) 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
simple binding properties on the page - simple but impossible Eric ASP .Net 2 12-07-2006 02:54 PM
Simple simple program error...please help tasheeta@gmail.com C++ 14 11-02-2005 12:52 PM
Need help: simple way for newbie to update a page Jim Royal HTML 7 07-24-2005 04:16 PM
help with simple dotnet page Tyro ASP .Net 1 02-28-2004 08:22 AM
Re: Warning Page Has Expired, I need to turn it OFF for a simple search page Kevin Spencer ASP .Net 2 07-08-2003 09:57 PM



Advertisments