sunny9 Level: Graduate
 Registered: 12-12-2006 Posts: 10
|
please help with quiz creation!!!
hey everyone,could really do with some help!
im trying to create a quiz made in visual basic with the answers stored in access. the questions should be called from the database along with the possible answers into textboxes into a visual basic 2005 form. this is what ive got so far -
tried changing the listbox to textbox but dosent work
please help!!!
Private Sub Form7_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strSQL As String = "SELECT * FROM questiontable"
objConnection.Open()
Dim objCommand As New _
System.Data.OleDb.OleDbCommand(strSQL, objConnection)
Dim objReader As System.Data.OleDb.OleDbDataReader
objReader = objCommand.ExecuteReader
If objConnection.State = ConnectionState.Open Then
If objReader.HasRows Then
While objReader.Read
ListBox1.Items.Add(objReader.GetValue(1))
End While
End If
End If
End Sub
End Class
|