473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

QueryString in SQL

I am trying to learn ASP.Net 2.0.

I have a page which lists Post Numbers in a gridview and returns the
selected Post Number.

Using this post number I want to display a second page using SQL like this:

select T1.NUMBER_R,
T2.SURNAME,
from D200M T1,
D500M T2,
D580M T3,
D200M T4,
where T1.PERSON_REF=T2.PERSON_REF and
T1.PERSON.REF=T3.PERSON_REF and
T3.REF=T4.REF and
T4.NUMBER_R='B040600002'

I want to replace the 'B040600002' above with the Post Number returned from
the first page and then display this page.

Please help!
Nirmal Singh
Sep 22 '06 #1
3 1167
Use a hyperlink column in your first page's gridview with the Id field
appended to the querystring like ?ID=<youritem>.

When a user clicks on a link, the querystring to the target page will have
the ID item on it, and you can retrieve it to use as the required parameter
for your SQL.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Nirmal Singh" wrote:
I am trying to learn ASP.Net 2.0.

I have a page which lists Post Numbers in a gridview and returns the
selected Post Number.

Using this post number I want to display a second page using SQL like this:

select T1.NUMBER_R,
T2.SURNAME,
from D200M T1,
D500M T2,
D580M T3,
D200M T4,
where T1.PERSON_REF=T2.PERSON_REF and
T1.PERSON.REF=T3.PERSON_REF and
T3.REF=T4.REF and
T4.NUMBER_R='B040600002'

I want to replace the 'B040600002' above with the Post Number returned from
the first page and then display this page.

Please help!
Nirmal Singh
Sep 22 '06 #2
Hi Peter,

I've added the hyperlink to the first page and it goes to the second page,
but then I get another problem.

How can I then retrieve this value and change my SQL? Or do I have to write
the SQL in such a way that it automatically gets updated when the page is
opened?

Thank you for your help.

Nirmal
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:E6**********************************@microsof t.com...
Use a hyperlink column in your first page's gridview with the Id field
appended to the querystring like ?ID=<youritem>.

When a user clicks on a link, the querystring to the target page will have
the ID item on it, and you can retrieve it to use as the required
parameter
for your SQL.
Peter

Sep 22 '06 #3
Peter,

I've worked it out. Because I am using an Oracle database I should be using
the symbol ':' for parameters not @.

Thanks for your help.

Nirmal

"Nirmal Singh" <ni**********@notthisbittowerhamlets.gov.ukwrote in message
news:O%****************@TK2MSFTNGP03.phx.gbl...
Hi Peter,

I've added the hyperlink to the first page and it goes to the second page,
but then I get another problem.

How can I then retrieve this value and change my SQL? Or do I have to
write the SQL in such a way that it automatically gets updated when the
page is opened?

Sep 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Arpan | last post by:
A link has the following URL: <a href="Page1.asp?cname=<%= Request.QueryString("cname") %>&cadd1=<%= Request.QueryString("cadd1") %>&cadd2=<%= Request.QueryString("cadd2") %>&cplace=<%=...
2
by: Mikael | last post by:
Hi All! I have a problem here and i can't see what it is... My parameters (value) are shopped off. exampe "Hello world" will end up like "hello" How should i adjust the syntax to get a whole...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
5
by: David | last post by:
Hello I need to take some values and place them in a string in the format of a querystring. Lets say I have: string State = "ACT"; string SearchString = "Tax"; int MinRelevance = 50;
4
by: Raterus | last post by:
Howdy, Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
3
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so...
1
by: beebee | last post by:
Hi all. I am having a bit of difficulty: Here is what is happening: I have an application that spits out a thankyou.aspx page and i would like to pass it the querystring values it had collected...
4
by: =?Utf-8?B?RVcgTmV3Ymll?= | last post by:
My apologies in advance if there is a better forum for this question. Given the following snippet: <script type="text/c#" runat="server"> protected void Page_Load(Object Sender, EventArgs e)...
3
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.