473,388 Members | 1,427 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,388 software developers and data experts.

Retrieving a value from an url

how do i retrieve a value from the URL. i need this value for a
select statement. example:

"SELECT Title from Suggestions WHERE SuggestionID=????"

the value of this id is not known and has to be taken from the url. so how do i go about doing this.What should i fill in for the ???? part?
Apr 5 '07 #1
3 1035
channaJ
67
how do i retrieve a value from the URL. i need this value for a
select statement. example:

"SELECT Title from Suggestions WHERE SuggestionID=????"

the value of this id is not known and has to be taken from the url. so how do i go about doing this.What should i fill in for the ???? part?
What do you mean by 'retrieve a value from the URL'? Are you trying to retrive a value comming as a QueryString which is appended to the url? or Are you trying to read a value from a file stored in a known url?
Apr 5 '07 #2
What do you mean by 'retrieve a value from the URL'? Are you trying to retrive a value comming as a QueryString which is appended to the url? or Are you trying to read a value from a file stored in a known url?

Thank u for the response. i will be more clear. i have 2 pages: default.aspx and default2.aspx. in my default.aspx page i have a report which has many customers id.on clicking a particular id he should be redirected to the dafault2.aspx page which shows the details of that customerID. so in the load event of my default2.aspc.cs page i am writing a query using the select statement which i showed earlier which will take value from the url when the user clicks a particular customerid.
ex: www.mywebsite/default2.aspx/?customerid=5
something like the above.
so in my query
"SELECT CustomerDetails from Customer WHERE CustomerID=????"
so what do i fill in that ??????
how do i retrieve the value from the url?
i hope i have made myself clear.thanking u in advance.
Apr 5 '07 #3
channaJ
67
Thank u for the response. i will be more clear. i have 2 pages: default.aspx and default2.aspx. in my default.aspx page i have a report which has many customers id.on clicking a particular id he should be redirected to the dafault2.aspx page which shows the details of that customerID. so in the load event of my default2.aspc.cs page i am writing a query using the select statement which i showed earlier which will take value from the url when the user clicks a particular customerid.
ex: www.mywebsite/default2.aspx/?customerid=5
something like the above.
so in my query
"SELECT CustomerDetails from Customer WHERE CustomerID=????"
so what do i fill in that ??????
how do i retrieve the value from the url?
i hope i have made myself clear.thanking u in advance.
Ok. What you are talking about here is QueryString. I'll take your example.
You are passing 'customerid=5' key value pair as a QueryString to the default2.aspx. So if you can take the value of it in 'Page_Load' event handler of default2.aspx you can perform your sql query right..?
Use the following code in your 'Page_Load' event handler.

Expand|Select|Wrap|Line Numbers
  1. string customerId = Request.QueryString["customerid"].ToString();
You'll have the value you passed in the variable 'customerId' :)
Hope this will make sence.

Channa
Apr 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Girish | last post by:
Hi Everyone, I am passing a form to a php script for further processing. I am able to retrieve the last value set for that given form variable using $variable=$_REQUEST;
1
by: Olaf Rabbachin | last post by:
Hi folks, I'm looking for a way of retrieving the default-value of a table's field within an Access 2003 MDB. Any hints on how to accomplish this from ASP.Net? Thanks, Olaf -- My .02:...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
15
by: gunnar.sigurjonsson | last post by:
I´m having some problem retrieving identity value from my newly inserted row into a view. I have two tables T1 and T2 which I define as following CREATE TABLE T1 ( id BIGINT GENERATED ALWAYS...
2
by: 4Ankit | last post by:
hello all, i am having some difficulty retrieving information from my form. I want to add content in my table but the content i want to add to the table is what the user inputs in my form. ...
5
by: Sanjay Pais | last post by:
I have a table with over 1.3 million rows. I am retrieving only 20 at a time using the with - over clauses In query analyser, the data is retrieved in under a second. When retrieving using the...
4
by: kaisersose1995 | last post by:
Hi, I'm trying to get Novell Netware information using vba into my access database and have no idea how to progress. Basically when i right click the properties on my computer the free space of a...
0
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
2
by: SV | last post by:
I have a login form with “Remember me on this computer” checkbox. I am creating cookie if checkbox is checked. My code is: If chk_remember.Checked = True Then Dim ckUserName As HttpCookie =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.