Hey guys! Can someone help me.? I have two tables named Questions and Examination, and two listviews named lstQuestion and lstChosenQuestion. I transfer the value of my lstQuestion to lstChosenQuestion through drag and drop and I already did that. My problem is saving the QuestionNumber equivalent of the transfered value on my second listview to sql DB, where in I am comparing the value of transfered data to its QuestionNumber equivalent from table Question, and saving the QuestionNumber equivalent to Examination table. Woah! I'm so sorry, it's kinda confusing, still, I hope someone can help me! Thanks! God Bless. :)


        If lstChosenQuestion.Items.Count = 0 Then
            'dset.Tables("Applicant").Rows.Count = 0
            MsgBox("No record(s) found.")
            MsgBox("Question Chosen!")

            With mycommandQuestion
                Dim Find As String
                Find = "SELECT QuestionNumber FROM Question WHERE Question = '" & lstChosenQuestion.Text & "'"
                myreader = .ExecuteReader
            End With

            If myreader.HasRows Then
                With mycommandSaveQuestion
                    .CommandType = CommandType.Text
                    .CommandText = "INSERT INTO Examination SELECT QuestionNumber = '" & Val(myreader("QuestionNumber").ToString) & "' "
                    .Connection = mycurrentconnection
                    myreader2 = .ExecuteReader
                End With

            End If
        End If

That's my code, there is an error saying "IndexOutOfRangeException was unhandled"