Click here to Skip to main content
15,914,066 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello guys new here!

I have a question that I hope someone here on this site can answer. I'm building an Math application in Visual C# where students can do math quizzes , tutorials etc.

With regards to building my math quizzes what I have decided to do is to build a table in SQL server that will hold questions and answers for a particular topic.
For example, one of the tables that I have in my database is as follows:-

Name of Table : Algebra

Columns : QuestionId (primary key) , Question, Answer, LevelOfDifficulty

What I want to do is to pull RANDOM questions from the above table and display them on a windows forms. In this windows form there will be labels which will hold the questions that I read from the 'Algebra' table in the database and there will be text boxes where the student can answer the question

Can someone please give me a of a methodology to build something like this???
Posted
Comments
Sergey Alexandrovich Kryukov 27-Mar-13 14:55pm    
Not really a valid question. Learn ADO.NET, write your code, ask specific questions if you stuck...
—SA
Darren501 27-Mar-13 14:58pm    
I'm not really looking for code or posting code. I just want a general idea how to approach this problem.
PIEBALDconsult 27-Mar-13 15:20pm    
Essentially what you asked breaks down to three things (SQL, Data Access, and UI). These three things should be kept separate.

1 solution

One common way is to sort on a reasonably random value, e.g. ORDER BY NEWID()
 
Share this answer
 
v2
Comments
Darren501 27-Mar-13 15:27pm    
Thank you for the response. I also found some code to help with with regards to the random selection of questions from a database

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1316&lngWId=5

However I still have the issue about displaying this information on a windows form. I know how to display information from a database one at time with labels. But if i have to display MULTIPLE data on a form in separate labels, what methodology should I us???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900