Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 1st, 2004, 11:49 AM
Registered User
 
Join Date: Mar 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default radios buttons and database problem

hi,
im using asp.net in vb.net and a oledbconnection. I am creating a multiple choice quiz system where 1 record in a datase contains the question and 4 possible answers and is displayed on the screen. the record also contains the correct answer which is NOT displayed on the screen. so far my code currently displays the questions from the database on the screen with the 4 possible answers attached to a radio button list. can anyone please tell me how i can get the answer selected by the user (when a radio button item is selected) and match it to the correct answer field in the database and increment a score by 1.

 
Old April 1st, 2004, 01:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

RadioButtonList.SelectedValue or RadioButtonList.SelectedItem(RadioButtonList.Selec tedIndex).Text

Compare it against the answer (I'm guessing in a data table), then call an update statement:

update scores set score = score + 1 where user = <user name>

or something like that. You can also increment a score field in a datarow, and then use the OLEDBDataAdapter.update statement to update it to the database.

Hope this helps,

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Nav buttons for database krisfr Beginning PHP 1 June 18th, 2007 05:25 PM
Front Page 98’s hover buttons problem...need help mIsS.cOlLy_cOoL Javascript 5 July 10th, 2006 12:35 AM
Having problem with hover buttons to function andyin Java Basics 0 July 9th, 2006 07:35 AM
Problem with dynamically rendered radio buttons daddyunit Javascript 1 January 19th, 2006 04:41 AM
Database driven Dynamic radio buttons :URGENT srichary BOOK: Beginning ASP 3.0 10 November 2nd, 2004 04:52 PM





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