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

Retrieving a session variable from a URL and using it in an SQL query

I am creating a movie review website for a project in visual studio...asp.net

The home page displays a table with the top news headlines. Each headline is hyperlinked to the ViewEntry.aspx page defining it with the id variable on the end such as ?id=2

To put it simple, my URL consists of

http://localhost:1672/.iis6/ViewEntry.aspx?id=15

Does anyone know how to take the 15 section of the URL, and use it in a query to display on the page?

The sql statement i have at the moment is;

SELECT * FROM [Latest_News] WHERE ([Id] = Session(id))

i would like to display only the data connected to the end value in the url
Dec 29 '07 #1
1 1176
shweta123
692 Expert 512MB
Hi,

If you want to get the value for id , then you can use Request.QueryString for this.
e.g.

SELECT * FROM [Latest_News] WHERE ([Id] =" & Request.QueryString ("id") & "





I am creating a movie review website for a project in visual studio...asp.net

The home page displays a table with the top news headlines. Each headline is hyperlinked to the ViewEntry.aspx page defining it with the id variable on the end such as ?id=2

To put it simple, my URL consists of

http://localhost:1672/.iis6/ViewEntry.aspx?id=15

Does anyone know how to take the 15 section of the URL, and use it in a query to display on the page?

The sql statement i have at the moment is;

SELECT * FROM [Latest_News] WHERE ([Id] = Session(id))

i would like to display only the data connected to the end value in the url
Dec 30 '07 #2

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

Similar topics

1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
1
by: KathyB | last post by:
Hi again, I save a fairly small xmlDocument to a single db field, xDoc.OuterXML using a SQL insert statement...this works fine. However, I then need to select that field (xmlWF) into an...
9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
2
by: Diffident | last post by:
Hello All, I have a nested user control i.e., Control B which is loaded from Control A. Control A is itself dynamically loaded from a web form. Control A has a "Save" button which loads the...
0
by: Diffident | last post by:
Hi Steve, Please find the code snippets below: Method A inside User Control A: ------------------------------------------- public void LoadDataGrid() { DataSet ds = new DataSet();
6
by: Ian Williamson | last post by:
Greetings, My company has an ASP.NET based enterprise product that is undergoing some changes and I need some community input to help solve a problem. In the current implementation, any given...
0
by: chrisoftoday | last post by:
I'm quite new to PHP so apologies if this is a really simple problem. I'm using a session variable to store a userID after login and trying to build a query using this variable. I have...
6
by: Vyoma | last post by:
This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I have been lurking around at several forums with regard to login and user authentication scripts and...
3
by: DNB | last post by:
I did post this message in C# group also... I would like to know what you guys think is the best way to access data: Asp.Net session vs. Database Queries. In our application we are using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.