944,183 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 1956
  • VB.NET RSS
Feb 8th, 2006
0

Need help with database linking!

Expand Post »
First of all, this is NOT for homework, so if you help, you WON'T be doing my homework for me! :lol: I am trying to create a quiz site for my school. I want the trachers to be able to create quizzes for their students. They will fill out a form to do so. However, with each new question they create, they need to associate it with a "QuizID", which will associate each question with their new quiz. How should i go about preventing duplicate "QuizIDs" so that questions and quizes don't merge, due to two identical "QuizIDs"? thanks! P.S. I am programming in Visual Basic.NET
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mikecool509 is offline Offline
21 posts
since Jan 2006
Feb 9th, 2006
0

Re: Need help with database linking!

I am not quite sure of your requirements.
You want a quiz and it has an id (say QZ1) and then you want a question with an id (say Q1) and then to associate it to the quiz... but you want to make sure that this question hasnt already been used?

If that is the case you need an association table (which i would use anyway so you could resuse the questions in other quizzes - ie you have a bank of questions and pull them out for a quiz - which is how most exams work anyway). So you have a table of quizzes each with their own id and a name (or whatever you need) and a table of questions (and probably a table of answers to the questions). Then a quiz-question association table which will have two columns (usually) one for the quiz id and one for the question id. Then make the two columns a primary key (that is the two columns together make one primary key). That forces the quizid, question id combination to be unique (and also fast for you searches etc). That way a question can only appear once in a quiz but can be in in other quizzes too as the quizid question id combination will be different.

If this is a bit confusing let me know and i will try and clarify
Reputation Points: 26
Solved Threads: 11
Posting Whiz in Training
f1 fan is offline Offline
275 posts
since Jan 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: outputing contents of a Treeview
Next Thread in VB.NET Forum Timeline: Quick VB2005 help....how do I get this basic app started?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC