-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfrmScore.vb
56 lines (48 loc) · 2.05 KB
/
frmScore.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Imports System.Data.OleDb
Imports System.Data
Public Class frmScore
Dim dConn As New OleDbConnection
Dim dCmd As OleDbCommand
Dim dt As New DataTable
Dim dr As OleDbDataReader
Private Sub frmScore_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
dConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Quizzer.mdb;")
dConn.Open()
Dim da As New OleDb.OleDbDataAdapter("SELECT StudName FROM StudDetails", dConn)
da.Fill(dt)
Dim i As Integer
For i = 0 To dt.Rows.Count - 1
cmbName.Items.Add(dt.Rows(i).Item(0))
Next
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Close()
End Sub
Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If txtUserName.Text = "mineurmind" And txtPassword.Text = "mineurmind" Then
grdScoreBoard.Visible = True
grdLogin.Visible = False
Else
MsgBox("Check User Name & Password", MsgBoxStyle.Information, "Quizzer")
txtPassword.Text = ""
txtUserName.Text = ""
End If
End Sub
Private Sub btnClose_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub cmbName_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbName.SelectedIndexChanged
Dim strSql As String = "SELECT * FROM StudDetails Where StudName= '" & cmbName.SelectedItem.ToString.Trim & "'"
Dim dCmd As New OleDbCommand(strSql, dConn)
dr = dCmd.ExecuteReader
dr.Read()
lblCollege.Text = dr.Item(1).ToString
lblScore.Text = dr.Item(3).ToString
lblStart.Text = dr.Item(4).ToString
lblEnd.Text = dr.Item(5).ToString
End Sub
End Class