I am basically a fresher in ASP.NET. I am building a website that has large contents of text data. The site also has a quiz based on some articles. I have two questions:

1) Which is the best way to store large amounts of text data? Is it good in a text file or should I use a database? If I use a database which is the best datatype to use?

2) The quiz has two tables at the moment - quiz and quizcontent. The quiz table has two columns atleast like quizid and quiztitle. The quizcontent table has columns like questionid, question, answer1, answer2, answer3, answer4, correctanswer, quizid and some other columns. I want the user to click on a quiz title. Based on the title I am planning to retrieve the quizid and then based on the quizid i plan to take all the questions of that particular quizid. My problem is this, I dont want to display all the questions at once, I want to display them one by one. So where do i store these retrieved questions and answers temporarily? If I use a temporary table on the server, suppose another user clicks on a quiz title after the first user, then the temporary table will be overwritten by the data from the latest request. so how can I store the data separately for each client.

Hopefully the reader is able to understand my question. Somebody pls help me with ideas. Your help is so much appreciated.

Thank you...

What database to use depends on how much data you expect to store (although that is also not that important unless the amount of data is expected to be HUGE). You could save your data in text or XML if you wanted but there would be a reasonable performance hit as the files got longer.
SQL or MySQL should be perfectly adequate for your needs.

To save the data storage problem you could simply request the next question from the database as one is solved, then you're only holding one question in memory at a time. An obvious issue here would be if you wanted the questions to be in random order - you'd need to handle that somehow.

Or you could just extract all of the questions for the quiz and store them in a dataTable in memory (but out of the database) and access them in turn or randomly. This could potentially clog your server depending on the number of questions, concurrent number of users, etc.

I hope that helps,

Hi Steve,

Thank you so much...I think that almost answers my question...I dont want the questions in a random order. So i believe then i can use the idea that you suggested.

Thanks once again for the reply


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.