QueryString in SQL

N

Nirmal Singh

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
 
G

Guest

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
 
N

Nirmal Singh

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
 
N

Nirmal Singh

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top