I am to finish a program which calculates grades for project students
The program should also calculate their grade for attendance
The member of staff who uses the program wants to be able to select a student from a list and see the number of times they have attended meetings.
So simply choosing student id from combo box i want to see output with how many times this student id was input in the database table and add grade for each meeting and devide it by 6 (max count of meetings). How do i get this info from my database?
my code so far:
artial Class _Default
Inherits System.Web.UI.Page
'declare a constant to store the number of meetings to be attended
Const MAX_APPTS As Integer = 6
'constant to store the text for select a student
Const NO_STUDENT As String = "(select a student)"
Protected Sub btnFind_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnFind.Click
'declare a variable to store the appointment reason
Dim Reason As String
'declares an instance of the database object allowing us to get the data from the table
Dim Appointments As New DatabaseTable("appointments.mdb", "select * from appointments", "#PN", "#PW")
'get the reason
Reason = Appointments.RecordNumber(0).Item("Reason")
'display the appointment details in the list concatenating the data
'lstAppointments.Items.Add(Reason)
'var to store the appointment count
Dim ApptCount As Integer
'var for the student number
Dim StudentNumber As String
lblapptCount.Text = ApptCount
'get the count of appointments
ApptCount = Appointments.Count
ApptCount(
'If statment here to show which student
' If StudentNumber Then
'End If?????????
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'if this is the first time the page has been display
If IsPostBack = False Then
'populate the student combo
Call DisplayStudents()
End If
End Sub
Sub DisplayStudents()
'this sub displays the student numbers in the combo
'open the table in the database
Dim Students As New DatabaseTable("appointments.mdb", "select * from Student order by studentnumber", "#PN", "#PW")
'var to store the student count
Dim StudentCount As Integer
'var for the counter
Dim Count As Integer
'var for the student number
Dim StudentNumber As String
'get the count of students
StudentCount = Students.Count
'clear the combo
cboStudent.Items.Clear()
'add the default text
cboStudent.Items.Add(NO_STUDENT)
'loop through each student
For Count = 0 To StudentCount - 1
'get the student no for this student
StudentNumber = Students.RecordNumber(Count).Item("StudentNumber")
'add it to the combo
cboStudent.Items.Add(StudentNumber)
Next
End Sub
Protected Sub cboStudent_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboStudent.SelectedIndexChanged
End Sub
End Class
help please