-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResultsAdmin.aspx.vb
49 lines (37 loc) · 1.27 KB
/
ResultsAdmin.aspx.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
Imports System.Data.OleDb
Partial Public Class ResultsAdmin
Inherits System.Web.UI.Page
Dim con As OleDbConnection
Dim query As String
Dim cmd As OleDbCommand
Dim dr As DataRow
Dim da As OleDbDataAdapter
Dim dt As DataTable
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim i, j As Integer
Dim poor, avg, exc As Integer
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:/login.mdb")
con.Open()
query = "select * from results"
dt = New DataTable()
da = New OleDbDataAdapter(query, con)
da.Fill(dt)
lbl_attempted.Text = lbl_attempted.Text & dt.Rows.Count
For i = 0 To Convert.ToInt32(dt.Rows.Count) - 1
dr = dt.Rows(i)
j = Convert.ToInt32(dr(1).ToString)
If j < 12 Then
poor = poor + 1
End If
If j >= 12 And j < 22 Then
avg = avg + 1
End If
If j >= 22 Then
exc = exc + 1
End If
Next
lbl_average.Text = lbl_average.Text & avg
lbl_excellent.Text = lbl_excellent.Text & exc
lbl_poor.Text = lbl_poor.Text & poor
End Sub
End Class