You should load
x
questions into
DataTable[
^] or
DataSet[
^] object, where
x
means: as many as you wish or requires.
If you want to get 30 random questions, you may use
Take()[
^] Linq method:
var rand = new Random();
var result = yourDataTable.AsEnumerable().OrderBy(r => rand.Next()).Take(30);
or server side solution:
Selecting Rows Randomly from a Large Table[
^]
When you've got a set of questions, you may go to the next question by using
Skip()[
^] and
Take()
together:
var nextQuestion = yourDataTable.AsEnumerable().Skip(currentIndex).Take(1);
Now, you,ve got an idea how to achieve your goals. Let's go to work!
Good luck!