title: Passing array into table
body: <p>I'm creating multiple choice question system.
  So far i create these 4 tables and 1 view.  </p>
  
  <p>The tables are tblQuestion, tblAnswer, tblQuiz, tblResult and tblResultDetail. 
  tblQuestion is to store the questions, tblAnswer to store the answers of the question,tblResult is to record for every user that answers the quiz, and store the users answers in TblResultDetails. </p>
  
  <p>Based on the code below, the data is read from view. (questiondr.Read). I use 1 , 2 , 3, 4 as it is the column name of the view. I did this to randomize the answers. </p>
  
  <pre><code>Dim MyArray(3) As String
      Dim commd As New SqlCommand("Select * From view_Question Where =QuestionID=@IdQuestion", conn)
      commd.Parameters.AddWithValue("@IdQuestion", count)
      Dim questiondr As SqlDataReader
      questiondr = commd.ExecuteReader
  
  
  If questiondr.Read() Then
      Me.lblTitle.Text = questiondr("txtQuestion")
  
      Me.ansrb1.Text = questiondr("1")
      MyArray(0) = questiondr("1")
  
      Me.ansrb2.Text = questiondr("2")
      MyArray(1) = questiondr("2")
  
      Me.ansrb3.Text = questiondr("3")
      MyArray(2) = questiondr("3")
  
      Me.ansrb4.Text = questiondr("4")
      MyArray(3) = questiondr("4")
  
  
      Dim userAns As String
  
      If Me.ansrb1.Checked = True Then
          userAns = MyArray(0)
      ElseIf Me.ansrb2.Checked = True Then
          answerId = MyArray(1)
      ElseIf Me.ansrb3.Checked = True Then
          userAns = MyArray(2)
      ElseIf Me.ansrb4.Checked = True Then
          userAns = MyArray(3)
      End If
  
  End If
  conn.Close()
  </code></pre>
  
  <p>End Sub</p>
  
  <p>And the problem is, how to pass the users answers into table tblResultDetails? </p>