Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 8th, 2004, 11:22 AM
Registered User
 
Join Date: Mar 2004
Location: london, Middlesex, United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Generating 5 unique random records from a database

Generating 5 unique random records from a database....

--------------------------------------------------------------------------------

im using ASP.NET/VB.NET. i have a MS Access database of questions and 4 multiple choice answers for each question. i would like to know if it is possible to randomly generate 5 different questions on a page with its multiple choice answers from the database at the same time but making sure that each question displayed is not displayed again in one instance.

there are various examples on the net but have'nt found any that can help me solve this. im really stuck now....can anyone please help me out??????

Thanks........


  #2 (permalink)  
Old March 8th, 2004, 01:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Either store the questions in the DB per user, or maybe storing a custom DataTable object holding the question ID's in it, then put the data table in the Session or Cache objects. If you are using the Cache object, make sure that in the global.asax.vb file, you specify "Cache.Remove" in the Session_End method. That way, when the session ends, they can start over. Or you can use the Cache and specify an expiration period too, and do it that way. If you want a predefined expiration period, you can't use the Session object.

What level of retention do you want? User sessions time, 20 minutes, 1 day, 2 days, a month?

Brian Mains
  #3 (permalink)  
Old March 8th, 2004, 05:59 PM
Registered User
 
Join Date: Mar 2004
Location: london, Middlesex, United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi brian,
thanks mate. yea ok will do. im designing this for a quiz system where users will be given multiple choice quizzes when they log into the site. im using sessions but i need to have a database with a standard set of questions that applies when the choose the option to take the quiz so i cannot have a sert of questions for each user. im fairly new to htis so have u come across any examples of this on the net? if so then the help is much appreciated and thanks for the help mate!!!

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating random numbers invisibleman18 Java Basics 2 March 26th, 2007 12:22 AM
Unique Records arholly Access 9 December 14th, 2006 08:22 AM
Generating random values gatsby VB How-To 3 August 4th, 2004 02:33 PM
help with random records ps124 ASP.NET 1.0 and 1.1 Basics 0 March 14th, 2004 10:57 PM
random records from database HammR PHP Databases 1 December 11th, 2003 02:03 PM



All times are GMT -4. The time now is 06:24 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.