Is it possible that when writing this:
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter
da = New OleDbDataAdapter("SELECT * FROM [Football Questions]", con)
da.Fill(dt)
lblQuestion.Text = dt.Rows(0).Item(1)
lblAnswer1.Text = dt.Rows(0).Item(2)
lblAnswer2.Text = dt.Rows(0).Item(3)
lblAnswer3.Text = dt.Rows(0).Item(4)
lblAnswer4.Text = dt.Rows(0).Item(5)
lblCorrectAnswer.Tag = dt.Rows(0).Item(6)
radAnswer1.Tag = dt.Rows(0).Item(2)
radAnswer2.Tag = dt.Rows(0).Item(3)
radAnswer3.Tag = dt.Rows(0).Item(4)
radAnswer4.Tag = dt.Rows(0).Item(5)
con.Close()
Can I replace the "0" from "dt.Rows(0)" with a variable that I can increment to cycle through each question in the database?
I currently have this to run when the confirm button is clicked and it works for the first question but further than that I'm stuck as how to show the third question
If radAnswer1.Checked Then
If lblAnswer1.Text = lblCorrectAnswer.Tag Then
Score += 1
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter
da = New OleDbDataAdapter("SELECT * FROM [Football Questions]", con)
da.Fill(dt)
lblQuestion.Text = dt.Rows(1).Item(1)
lblAnswer1.Text = dt.Rows(1).Item(2)
lblAnswer2.Text = dt.Rows(1).Item(3)
lblAnswer3.Text = dt.Rows(1).Item(4)
lblAnswer4.Text = dt.Rows(1).Item(5)
lblCorrectAnswer.Tag = dt.Rows(1).Item(6)
radAnswer1.Tag = dt.Rows(1).Item(2)
radAnswer2.Tag = dt.Rows(1).Item(3)
radAnswer3.Tag = dt.Rows(1).Item(4)
radAnswer4.Tag = dt.Rows(1).Item(5)
con.Close()
End If