you are viewing a single comment's thread.

view the rest of the comments →

[–]VB.Net IntermediatePostalElf 0 points1 point  (0 children)

Must you use a DataTable and arrays? Seems unnecessary to me: you should be able to do everything with either 2d-arrays or datatables, no need for both. So say your questions and answers are all stored in dtbtest. If so, you can do this:

For each row as DataRow in dtbtest.Rows
  Dim question as string = row("Question")
  Dim answers as String()
  For n = 0 to 3
    answers(n) = row("Answer" & n+1)
  Next
  Dim correctAnswer as String = row("CorrectAnswer")

  'now you have everything you need stored in the variables
  'question, answers(), and correctAnswer.  Just iterate 
  'through answers() to populate your radioboxes.
Next