Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Sub Data(Position As Integer)
- Declare connection done
- Dim com As New MySqlCommand("SELECT * FROM Question WHERE QID = @QID ", MySQLConnection)
- com.Parameters.AddWithValue("@QID", FrmStandardQuizzes.CboQ.Text)
- Dim MysqlAdapter As New MySqlDataAdapter(com)
- MysqlAdapter.Fill(MyTable)
- TxtInsertQuestion.Text = MyTable.Rows(Position)(1).ToString
- End Sub
- Private Sub BtnNext_Click(sender As Object, e As EventArgs) Handles BtnNext.Click
- Dim Position As Integer = 0
- Index += 1
- Data(Index)
- Declared con
- Dim com As New MySqlCommand("SELECT * FROM Quiz WHERE NQuestions = @NumberofQuestions AND QId = @QId", MySQLConnection)
- Mycom.Parameters.AddWithValue("@QuizId", FrmQ.CboQ.Text)
- Mysqlcom.Parameters.AddWithValue("@NQuestions", LblNQuestions.Text)
- Dim MysqlAdapter As New MySqlDataAdapter(com)
- MysqlAdapter.Fill(MyTable)
- LblNQuestions.Text = MyTable.Rows(Position)(2).ToString
- If Index > LblNQuestions.Text Then
- Index = LblNQuestions.Text
- MessageBox.Show("You have successfully completed the Quiz.")
- End If
- End Sub
- Private Sub BtnQBefore_Click(sender As Object, e As EventArgs) Handles BtnQBefore.Click
- Index -= 1
- If Index < 0 Then
- Index = 0
- MessageBox.Show(" This is the first question.")
- End If
- Data(Index)
- LblQNumber.Text = Count.ToString()
- End Sub
- Private Sub Q_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Data(Index)
- Private Sub BtnCheckA_Click(sender As Object, e As EventArgs) Handles BtnCheckA.Click
- Dim Count As Integer = 0
- Declared con
- Try
- MySQLConnection.Open()
- Dim com As New MySqlCommand("SELECT * FROM Ques WHERE QID = @ChooseQ ", MySQLConnection)
- com.Parameters.AddWithValue("@ChooseQ", FrmStandardQuizzes.CboQ.Text)
- Dim MysqlAdapter As New MySqlDataAdapter(com)
- Dim Position As Integer
- Dim MySqlDataReader As MySqlDataReader = MysqlCommand.ExecuteReader()
- MySqlDataReader.Dispose()
- MysqlAdapter.Fill(MyTable)
- If TxtInsertAnswer.Text = MyTable.Rows(Position)(2).ToString Then
- TxtFeedback.Text = MyTable.Rows(Position)(3).ToString
- Count = Count + 1
- ElseIf TxtInsertAnswer.Text <> MyTable.Rows(Position)(2).ToString Then
- TxtFeedback.Text = MyTable.Rows(Position)(4).ToString
- End If
- End Sub
Add Comment
Please, Sign In to add comment