Professional Documents
Culture Documents
In partial fulfillment of
Under the guidance of Mr. Rakesh Pathak, Asst. Prof., Dept. of Computer
Science
Each step is a small blessing, a little victory that brings us an incomparable sense of
pure, unadulterated joy. As this is our first project, it was difficult for us to develop
it all alone. We are fortunate that we are surrounded by people who are expert in
their respective fields and thus shared their knowledge with us and made our work
easier.
Firstly, we would like thank the almighty god for all the blessings which he bestowed
upon us and kept us patient during this whole development process. We would like
to thank our college’s Principal- Fr. Dr. T Nishant, SJ, who was very cooperative
and helped us in time management, wherever we lagged behind the schedule.
We would specially like to thank our project guide- Mr. Rakesh pathak, who always
kept motivating us and also helped us wherever we needed him to clear our doubts.
We would also thank all the faculty members of BCA department who supported us
in development process by suggesting us to add new features in our project.
Certificate
This is to certify that the project entitled Coaching Management System submitted
to Aryabhatta Knowledge University in fulfillment of the requirement for the award
of Degree of Bachelors in computer applications [BCA]; the matter embodied in this
project is a genuine work done by me.
…………………………………. ………………………………
…………………………….
We, hereby declare that the work being presented in this project, titled “Coaching
Management System” as a part of course curriculum of Bachelor In Computer
Application [BCA], is an authentic record of my own work carried out under the
guidance of Mr. Rakesh Pathak, Asst. Prof. in the Dept of Computer Science , St.
Xavier’s College of Management And Technology, Patna.
This project will handle whole the activities of the coaching. CMS has most of
facilities that a modern coaching requires to computerize its day-to-day jobs.
It provides facilities to keep the record of student, fees, taking exams, teaching and
non-teaching staff with all their required details along with all required transaction
handling. It has facilities to generate various types of reports, which are required by
the management during normal business operation to operate the business
effectively.
Purpose: The purpose of the project is to build an application program that can
reduce the manual work for managing the records of the students, teachers and fees.
Project scope: The scope of this software is local i.e. it should be accessed within a
system (PC, Laptop).
Objectives
This project records the details of students, teachers, users, exams, results and fees. The
purpose of the project is to build an application program to reduce the manual work
for managing the records of students, teachers, users, exams, results and fees. It displays
the details ofstudents, teachers, users, exams, results, answer sheets, fees paid,
remaining unpaid fees. It maintains error free database and easily incorporates the
future developments and changes.
In other word we can say that our project has the following objectives:-
Hardware requirements:
SQL Server 2019: It allows us to Integrate data from structured and unstructured
data sources.
Microsoft SQL Server management studio 18: It is RDBMS that run on the
SQL. It has capacity to support a huge variety of transaction processing as well
as business intelligence and analytics in corporate IT environments.
SQL: : It can be used to share and manage data, particularly data that is found in
relational database management systems, which include organized into tables.
Multiple files, each containing tables of data, also may be related together by a
common field. Using SQL, you can query, update, and reorganize data, as well as
create and modify the schema of a database system and control access to its data.
1. Admin can add, update, delete and display students, teachers, users, classes,
streams, subjects, fees, exams into database.
2. Admin and Teacher can view result and answer sheet of students.
3. Admin, Teacher and Student can change his/her password.
4. Teacher can add, update, delete and display questions for exams.
5. Students can give their exam and view his/her result or answer sheet.
6. Getting details of student and their remaining unpaid fees.
Non-Functional Requirements
• Performance requirements
The Application is such that it stands up to the user expectations
The response of all the operation is good
Response to user’s errors and undesired situations has been taken care of
to ensure that the Application operates without any uncertainty
• Only authorized users are allowed to enter into the system and work. It
providing an extensive role based authorization.
Feasibility study
Technical Feasibility
The system is proposed to be developed for window form application.
Therefore we have chosen the visual basic as our front end and SQL server
2019 as backend.
Economic Feasibility
Since this project is a partial fulfillment of our Degree course Bachelor in
computer application. So money related concerns has not come and the project
has been developed by our team member without charging any cost.
Schedule Feasibility
Time evaluation is the most important consideration in the development of
project. The time schedule required for the developed of this project is very
important since more development time effort machine time, cost and cause
delay in the development of other systems. A reliable Coaching Management
System can be developed in the considerable amount of time.
Behavioral Feasibility
The proposed system is also behaviorally feasible as it is very user friendly. The
users can easily learn to use the system and can adapt themselves according to
the system.
Modular design:
Teacher
eeeerer
Admin Student
Modules
Admin Module
• Login
• Dashboard
• Manage Education
• Manage Exam
• Manage Student
• Manage Fees
• View Result
• Answer Sheet
• Manage Teacher
• Manage User
• Setting
Teacher Module
• Login
• Dashboard
• Manage Question
• View Result
• Answer Sheet
• Settings
Student Module
• Login
• Dashboard
• Exam
• Result
• settings
PROCESS LOGIC OF MODULE:
ADMIN MODULE
LOGIN
MANAGE EDUCATION
MANAGE STUDENT
MANAGE FEES
MANAGE EXAM
VIEW RESULT
ANSWER SHEET
MANAGE TEACHER
MANAGE USER
SETTINGS
LOGIN
MANAGE QUESTION
VIEW RESULT
ANSWER SHEET
SETTINGS
LOGIN
EXAM
RESULT
SETTINGS
Admin flowchart:
Teacher flowchart:
Student flowchart:
USE CASE DIAGRAM
Admin:
Teacher:
Student:
Screenshots of Admin module:
LOGIN PAGE
21
22
23
24
Screenshots of Student module
25
26
Screenshots of Teacher module:
27
VB FILE
Database_Connectivity.vb
Imports System.Data.SqlClient
Imports System.Data
Module Database_Connectivity
Public connectionString As String
Public cnn, con As SqlConnection
Public qry, qry1 As String
Public cmd, cmd1 As SqlCommand
Public dr, dr1 As SqlDataReader
Public ds As DataSet
Public Sub connection_open()
connectionString = "Data Source=.\SQLEXPRESS;Initial
Catalog=CMSDB;Integrated Security=True;"
cnn = New SqlConnection(connectionString)
Try
cnn.Open()
Catch ex As Exception
MsgBox("Cannnot open database connection...You need to setup
database", MsgBoxStyle.Critical)
End Try
End Sub
Public Sub connection_close()
cnn.Close()
End Sub
End Module
Admin_Dashboard_Form.vb
Imports System.Data.SqlClient
Imports System.Data
28
'Displaying total users
qry = "select count (*) from Login"
cmd = New SqlCommand(qry, cnn)
TotalUsers = cmd.ExecuteScalar
lblTotalUser.Text = TotalUsers
lblUsertype.Text = Login_Form.cmbUserType.Text
lblUsername.Text = Login_Form.txtUserName.Text
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Admin_Panel_Form.vb
Imports System.Data.SqlClient
Imports System.Data
End Sub
With Admin_Dashboard_Form
.TopLevel = False
panelCentre.Controls.Add(Admin_Dashboard_Form)
.BringToFront()
.Show()
End With
End Sub
32
Private Sub btnAdFees_Click(sender As Object, e As EventArgs) Handles
btnAdFees.Click
With Manage_Fees_Form
.TopLevel = False
panelCentre.Controls.Add(Manage_Fees_Form)
.BringToFront()
.Show()
End With
End Sub
End Class
Answer_Sheet_Form.vb
Imports System.Data.SqlClient
Imports System.Data
33
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
End Try
End If
End Sub
txtAnsSheetOptionB.BackColor = Color.White
txtAnsSheetOptionB.ForeColor = Color.Black
txtAnsSheetOptionC.BackColor = Color.White
txtAnsSheetOptionC.ForeColor = Color.Black
txtAnsSheetOptionD.BackColor = Color.White
txtAnsSheetOptionD.ForeColor = Color.Black
End If
txtAnsSheetOptionB.BackColor = Color.White
txtAnsSheetOptionB.ForeColor = Color.Black
txtAnsSheetOptionC.BackColor = Color.White
txtAnsSheetOptionC.ForeColor = Color.Black
txtAnsSheetOptionD.BackColor = Color.White
txtAnsSheetOptionD.ForeColor = Color.Black
End Sub
'Showing answersheet data in textboxes when previous and next button
clicked
Public Sub PrevNextQues()
DontColourOptButton()
CorrectAnswer = ""
GivenAnswer = ""
Try
connection_close()
connection_open()
qry = "SELECT QuesNo, Question, OptionA, OptionB, OptionC,
OptionD, Answer, GivenAnswer FROM AnswerSheet
WHERE RegNo = '" & txtAnsSheetRegNo.Text & "'
AND Class = '" & cmbAnsSheetClass.Text & "'
AND Stream = '" & cmbAnsSheetCourse.Text & "'
AND Subject = '" & cmbAnsSheetSubject.Text & "'
AND QuesNo = '" & QNo & "'"
cmd = New SqlCommand(qry, cnn)
37
Dim dt As New DataTable()
Dim da As New SqlDataAdapter(cmd)
da.Fill(dt)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While dr.Read
txtAnsSheetQuesNo.Text = dr.Item("QuesNo").ToString
txtAnsSheetQuestion.Text = dr.Item("Question").ToString
txtAnsSheetOptionA.Text = dr.Item("OptionA").ToString
txtAnsSheetOptionB.Text = dr.Item("OptionB").ToString
txtAnsSheetOptionC.Text = dr.Item("OptionC").ToString
txtAnsSheetOptionD.Text = dr.Item("OptionD").ToString
txtAnsSheetAnswer.Text = dr.Item("Answer").ToString
txtAnsSheetGivenAns.Text =
dr.Item("GivenAnswer").ToString
CorrectAnswer = dr.Item("Answer").ToString()
GivenAnswer = dr.Item("GivenAnswer").ToString()
ColourOptBtn()
End While
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
End Try
End Sub
'Showing answersheet data in grid view when previous and next button
clicked
Public Sub ShowPrevNextAns()
Try
connection_close()
connection_open()
qry = "SELECT QuesNo, Question, OptionA, OptionB, OptionC,
OptionD, Answer, GivenAnswer FROM AnswerSheet
WHERE RegNo = '" & txtAnsSheetRegNo.Text & "'
AND Class = '" & cmbAnsSheetClass.Text & "'
AND Stream = '" & cmbAnsSheetCourse.Text & "'
AND Subject = '" & cmbAnsSheetSubject.Text & "'
AND QuesNo = '" & QNo & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewAnsSheet.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
38
End Try
End Sub
39
qry = "SELECT QuesNo, Question, OptionA, OptionB, OptionC,
OptionD, Answer, GivenAnswer FROM AnswerSheet
WHERE RegNo = '" & txtAnsSheetRegNo.Text & "'
AND Class = '" & cmbAnsSheetClass.Text & "'
AND Stream = '" & cmbAnsSheetCourse.Text & "'
AND Subject = '" & cmbAnsSheetSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewAnsSheet.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
End Try
End Sub
41
QNo = 1
End Sub
End Class
Login_Form.vb
Imports System.Data.SqlClient
Imports System.Data
43
connection_close()
Student_Panel_Form.ShowDialog()
Else
MsgBox("Invalid Username and Password.",
MsgBoxStyle.Critical)
connection_close()
End If
Manage_Education_Form.vb
Imports System.Data.SqlClient
Imports System.Data
Dim i As Integer
Dim EducationExist, CheckEducationExist As Boolean
End Sub
Public Sub Education_disp()
Try
connection_close()
connection_open()
If cmbEducationClass.Text <> "" And cmbEducationStream.Text =
"" And cmbEducationSubject.Text = "" Then
qry = "SELECT * FROM Education
WHERE Class = '" & cmbEducationClass.Text & "'"
47
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
ElseIf cmbEducationClass.Text = "" And
cmbEducationStream.Text <> "" And cmbEducationSubject.Text = "" Then
qry = "SELECT * FROM Education
WHERE Stream = '" & cmbEducationStream.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
ElseIf cmbEducationClass.Text = "" And
cmbEducationStream.Text = "" And cmbEducationSubject.Text <> "" Then
qry = "SELECT * FROM Education
WHERE Subject = '" & cmbEducationSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
ElseIf cmbEducationClass.Text <> "" And
cmbEducationStream.Text <> "" And cmbEducationSubject.Text = "" Then
qry = "SELECT * FROM Education
WHERE Class = '" & cmbEducationClass.Text & "'
AND Stream = '" & cmbEducationStream.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
48
ElseIf cmbEducationClass.Text <> "" And
cmbEducationStream.Text = "" And cmbEducationSubject.Text <> "" Then
qry = "SELECT * FROM Education
WHERE Class = '" & cmbEducationClass.Text & "'
AND Subject = '" & cmbEducationSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
ElseIf cmbEducationClass.Text = "" And
cmbEducationStream.Text <> "" And cmbEducationSubject.Text <> "" Then
qry = "SELECT * FROM Education
WHERE Stream = '" & cmbEducationStream.Text & "'
AND Subject = '" & cmbEducationSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
ElseIf cmbEducationClass.Text <> "" And
cmbEducationStream.Text <> "" And cmbEducationSubject.Text <> "" Then
qry = "SELECT * FROM Education
WHERE Class = '" & cmbEducationClass.Text & "'
AND Stream = '" & cmbEducationStream.Text & "'
AND Subject = '" & cmbEducationSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewEducation.DataSource = dt
End Using
End Using
End If
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
End Try
End Sub
49
Private Sub btnExamSearch_Click(sender As Object, e As EventArgs)
Handles btnEducationSearch.Click
'Checking Validation
If cmbEducationClass.Text = "" And cmbEducationStream.Text = ""
And cmbEducationSubject.Text = "" Then
MsgBox("Please enter search details", MsgBoxStyle.Critical)
Else
DataGridViewEducation.DataSource = Nothing
DataGridViewEducation.Refresh()
CheckEducationSearch()
If EducationExist = True Then
'Show Exam in GridView
Try
connection_close()
connection_open()
Education_disp()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MsgBox("Exam does not exist", MsgBoxStyle.Critical)
End If
End If
End Sub
50
Private Sub btnExamDisplayAll_Click(sender As Object, e As EventArgs)
Handles btnEducationDisplayAll.Click
DisplayAllEducation()
End Sub
Else
53
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End If
End If
End Sub
Private Sub DataGridViewEducation_CellClick(sender As Object, e As
DataGridViewCellEventArgs) Handles DataGridViewEducation.CellClick
Try
connection_close()
connection_open()
i =
Convert.ToInt32(DataGridViewEducation.SelectedCells.Item(0).Value.ToStrin
g)
qry = "SELECT * FROM Education WHERE id = '" & i & "'"
cmd = New SqlCommand(qry, cnn)
Dim dt As New DataTable()
Dim da As New SqlDataAdapter(cmd)
da.Fill(dt)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While dr.Read
cmbEducationClass.Text = dr.Item("Class").ToString
cmbEducationStream.Text = dr.Item("Stream").ToString
cmbEducationSubject.Text = dr.Item("Subject").ToString
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Manage_Exam_Form.vb
Imports System.Data.SqlClient
Imports System.Data
Public Class Manage_Exam_Form
Dim i As Integer
Dim Hr, Min, Sec, ExamDuration, TempHr, TempMin, TempSec, ShowTime As
Integer
Dim ExamExist, EducationExist As Boolean
55
Private Sub DataGridViewExam_CellClick(sender As Object, e As
DataGridViewCellEventArgs) Handles DataGridViewExam.CellClick
Try
connection_close()
connection_open()
i =
Convert.ToInt32(DataGridViewExam.SelectedCells.Item(0).Value.ToString)
qry = "SELECT * FROM Exam WHERE Id = '" & i & "'"
cmd = New SqlCommand(qry, cnn)
Dim dt As New DataTable()
Dim da As New SqlDataAdapter(cmd)
da.Fill(dt)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While dr.Read
cmbExamClass.Text = dr.Item("Class").ToString
cmbExamStream.Text = dr.Item("Stream").ToString
cmbExamSubject.Text = dr.Item("Subject").ToString
txtExamTotalQues.Text = dr.Item("TotalQues").ToString
txtExamTotalMarks.Text = dr.Item("TotalMarks").ToString
ShowTime = dr.Item("TimeDuration")
TempHr = ShowTime
TempMin = ShowTime
TempSec = ShowTime
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
56
Private Sub btnExamSearch_Click(sender As Object, e As EventArgs)
Handles btnExamSearch.Click
'Checking Validation
If cmbExamClass.Text = "" And cmbExamStream.Text = "" And
cmbExamSubject.Text = "" Then
MsgBox("Please enter search details", MsgBoxStyle.Critical)
Else
CheckExam()
If ExamExist = True Then
'Show Exam in GridView
Try
connection_close()
connection_open()
Exam_disp()
Catch ex As Exception
MsgBox(ex.Message)
End Try
Else
MsgBox("Exam does not exist", MsgBoxStyle.Critical)
End If
End If
End Sub
57
Public Sub CheckEducation()
If cmbExamClass.Text <> "" And cmbExamStream.Text <> "" And
cmbExamSubject.Text <> "" Then
Try
connection_close()
connection_open()
qry = "SELECT * FROM Education
WHERE Class = '" & cmbExamClass.Text & "'
AND Stream = '" & cmbExamStream.Text & "'
AND Subject = '" & cmbExamSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read = True Then
EducationExist = True
Else
EducationExist = False
End If
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
End Try
End If
End Sub
End If
End If
End Sub
Private Sub btnExamDelete_Click(sender As Object, e As EventArgs)
Handles btnExamDelete.Click
'Checking Validation
If cmbExamClass.Text = "" And cmbExamStream.Text = "" And
cmbExamSubject.Text = "" And txtExamTotalQues.Text = "" And
txtExamTotalMarks.Text = "" Then
60
MsgBox("Please Enter All Required Fields",
MsgBoxStyle.Critical)
Else
CheckEducation()
CheckExam()
If EducationExist = False Then
MsgBox("Education does not exist.", MsgBoxStyle.Critical)
ElseIf ExamExist = False Then
MsgBox("Exam does not exist.", MsgBoxStyle.Critical)
ElseIf EducationExist = True And ExamExist = True Then
If MsgBox("Are you sure you want to delete?",
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
'Deleting Data
Try
qry = "DELETE FROM Exam
WHERE Class = '" & cmbExamClass.Text & "'
AND Stream = '" & cmbExamStream.Text & "'
AND Subject = '" & cmbExamSubject.Text & "'"
connection_open()
cmd = New SqlCommand(qry, cnn)
cmd.ExecuteNonQuery()
MsgBox("Exam Deleted Successfully!",
MsgBoxStyle.Information, "Deleted")
DisplayAllExam()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
Else
MsgBox("Invalid Inputs in Total Questions or Total
Marks.", MsgBoxStyle.Critical)
End If
End If
End Sub
End Class
Manage_Fees_Form.vb
Imports System.Data.SqlClient
Imports System.Data
End If
End Sub
End Sub
End While
connection_close()
connection_open()
i =
Convert.ToInt32(DataGridViewFees.SelectedCells.Item(1).Value.ToString)
qry = "SELECT * FROM Fees WHERE RegNo = '" & i & "'"
64
cmd = New SqlCommand(qry, cnn)
Dim dt1 As New DataTable()
Dim da1 As New SqlDataAdapter(cmd)
da1.Fill(dt1)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While dr.Read
TotalFees = CDbl(dr.Item("Fee").ToString())
'MsgBox(TotalFees)
FeePaid = CDbl(dr.Item("FeePaid").ToString())
'MsgBox(FeePaid)
FeeDues = TotalFees - FeePaid
'MsgBox(FeeDues)
lblFeeDues.Text = FeeDues.ToString
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btnStudentSearch_Click(sender As Object, e As EventArgs)
Handles btnStudentSearch.Click
If txtStudentRegistrationNumber.Text = "" Then
MsgBox("Please Enter Registration Number Detail",
MsgBoxStyle.Critical)
Else
Try
connection_close()
connection_open()
End If
End Sub
65
Private Sub btnStudentDisplayAll_Click(sender As Object, e As
EventArgs)
Try
connection_close()
connection_open()
qry = "SELECT * FROM Fees"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewFees.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
66
qry = "UPDATE Fees SET RegNo = '" &
txtStudentRegistrationNumber.Text & "', Fee = '" & txtFee.Text & "',
FeePaid = '" & txtFeePaid.Text & "' WHERE RegNo = '" &
txtStudentRegistrationNumber.Text & "'"
connection_close()
connection_open()
qry1 = "SELECT * FROM Fees WHERE RegNo = '" &
txtStudentRegistrationNumber.Text & "'"
cmd1 = New SqlCommand(qry1, cnn)
dr = cmd1.ExecuteReader
If dr.Read() = True Then
cmd = New SqlCommand(qry, cnn)
dr.Close()
cmd.ExecuteNonQuery()
MsgBox("Fees Record Updated Successfully!",
MsgBoxStyle.Information, "Update Success")
connection_close()
End If
End If
End If
data_disp()
Catch ex As Exception
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End Try
End If
End Sub
Catch ex As Exception
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End Try
End If
End Sub
Private Sub btnStudentDisplayAll_Click_1(sender As Object, e As
EventArgs) Handles btnStudentDisplayAll.Click
Try
connection_close()
qry = "SELECT * FROM Fees"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewFees.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Manage_Question_Form.vb
Imports System.Data.SqlClient
Imports System.Data
69
Public Sub ShowQuesInGridView()
Try
connection_close()
connection_open()
qry = "SELECT * FROM
Questions WHERE Class = '" & cmbClass.Text & "'
AND Stream = '" & cmbStream.Text & "'
AND Subject = '" & cmbSubject.Text & "'
AND QuesNo = '" & QNo & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewQuestion.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox("Invalid Inputs", MsgBoxStyle.Critical)
End Try
End Sub
75
If QuestionExist = True Then
MaxQNo = MaxQuesValue()
If QNo < 1 Or QNo > (MaxQNo + 1) Then
MsgBox("Invalid Q.No:",
MsgBoxStyle.Information)
ElseIf QNo = 1 Then
MsgBox("Q.No: already exist.",
MsgBoxStyle.Critical)
ElseIf QNo = MaxQNo + 1 Then
InsertQues()
ShowAllQuesInGridView()
txtQuesNo.Text = QNo + 1
ClearQuesAns()
End If
ElseIf QuestionExist = False Then
If QNo = 1 Then
InsertQues()
ShowAllQuesInGridView()
txtQuesNo.Text = QNo + 1
ClearQuesAns()
Else
MaxQNo = MaxQuesValue()
If QNo = MaxQNo + 1 Then
InsertQues()
ShowAllQuesInGridView()
txtQuesNo.Text = QNo + 1
ClearQuesAns()
Else
MsgBox("Invalid Q.No:",
MsgBoxStyle.Critical)
End If
End If
End If
End If
End If
End If
End Sub
End Class
Manage_Student_Form.vb
Imports System.Data.SqlClient
Imports System.Data
Public Class Manage_Student_Form
Dim i As Integer
End If
End Sub
End Try
End Sub
End If
End Sub
Private Sub btnStudentSearch_Click(sender As Object, e As EventArgs)
Handles btnStudentSearch.Click
If txtStudentRegistrationNumber.Text = "" And
txtStudentFullName.Text = "" And txtStudentEmail.Text = "" And
cmbStudentClass.Text = "" And cmbStudentStream.Text = "" And
cmbStudentSubject.Text = "" Then
MsgBox("Please Enter Student Detail", MsgBoxStyle.Critical)
Else
Try
connection_close()
connection_open()
84
Private Sub btnStudentDisplayAll_Click(sender As Object, e As
EventArgs) Handles btnStudentDisplayAll.Click
Try
connection_close()
connection_open()
qry = "SELECT * FROM Students"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewStudent.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Sub
txtStudentEmail.Text = dr.GetString(9).ToString()
txtStudentAddress.Text = dr.GetString(10).ToString()
txtPhoneNumber.Text = dr.Item("PhNo")
txtStudentAge.Text = dr.Item("Age")
pictureStudent.Image =
Image.FromFile(dr.Item("Picture").ToString)
End While
Catch ex As Exception
End Try
End Sub
Manage_Teacher_Form.vb
Imports System.Data.SqlClient
Imports System.Data
88
qry = "INSERT INTO Teachers (StaffId, Name, Gender,
Address, PhNo, Email, Salary, Picture, Age) VALUES ('" &
txtTeacherId.Text & "', '" & txtTeacherFullName.Text & "', '" &
cmbTeacherGender.Text & "', '" & txtTeacherAddress.Text & "', '" &
txtTeacherPhoneNumber.Text & "', '" & txtTeacherEmail.Text & "', '" &
txtTeacherSalary.Text & "', '" & pictureTeacher.ImageLocation & "', '" &
txtTeacherAge.Text & "')"
connection_open()
qry1 = "SELECT * FROM Teachers WHERE StaffId = '" &
txtTeacherId.Text & "'"
cmd1 = New SqlCommand(qry1, cnn)
dr = cmd1.ExecuteReader
If dr.Read() = False Then
cmd = New SqlCommand(qry, cnn)
dr.Close()
cmd.ExecuteNonQuery()
MsgBox("New Teacher Added Successfully!",
MsgBoxStyle.Information, "Added Success")
connection_close()
End If
End If
connection_close()
data_disp()
End If
Catch ex As Exception
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End Try
End Sub
89
Private Sub btnStudentDelete_Click(sender As Object, e As EventArgs)
Handles btnTeacherDelete.Click
If txtTeacherId.Text = "" Then
MsgBox("Please Enter Teacher Id", MsgBoxStyle.Critical)
Else
Try
'Checking Data
qry = "SELECT * FROM Teachers WHERE StaffId = '" &
txtTeacherId.Text & "'"
connection_open()
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read = False Then
MsgBox("Record Does Not Exists!",
MsgBoxStyle.Critical, "Duplicate")
connection_close()
Else
If MsgBox("Are you sure you want to delete?",
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
qry = "SELECT * FROM Teachers WHERE StaffId = '"
& txtTeacherId.Text & "'"
connection_open()
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read = True Then
qry1 = "DELETE FROM [dbo].[Teachers]
WHERE StaffId = '" & txtTeacherId.Text & "'"
connection_open()
cmd1 = New SqlCommand(qry1, cnn)
cmd1.ExecuteNonQuery()
MsgBox("Teacher Deleted Successfully!",
MsgBoxStyle.Information, "Deleted")
connection_close()
data_disp()
End If
End If
End If
Catch ex As Exception
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End Try
End If
End Sub
90
Private Sub btnStudentSearch_Click(sender As Object, e As EventArgs)
Handles btnTeacherSearch.Click
If txtTeacherId.Text = "" And txtTeacherFullName.Text = "" And
txtTeacherEmail.Text = "" And txtTeacherSalary.Text = "" Then
MsgBox("Please Enter Teacher Detail", MsgBoxStyle.Critical)
Else
Try
connection_open()
connection_close()
qry = "SELECT * FROM Teachers WHERE StaffId = '" &
txtTeacherId.Text & "' OR Name = '" & txtTeacherFullName.Text & "' OR
Email = '" & txtTeacherEmail.Text & "' OR Salary = '" &
txtTeacherSalary.Text & "'"
cmd = New SqlCommand(qry, cnn)
Using da As New SqlDataAdapter()
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewTeacher.DataSource = dt
End Using
End Using
Catch ex As Exception
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End Try
End If
End Sub
End Try
End Sub
91
Private Sub btnStudentUpdate_Click(sender As Object, e As EventArgs)
Handles btnTeacherUpdate.Click
'Checking Validation
If txtTeacherId.Text = "" Then
MsgBox("Please Enter Teacher Id", MsgBoxStyle.Critical)
Else
Try
'Checking Data
qry = "SELECT * FROM Teachers WHERE StaffId = '" &
txtTeacherId.Text & "'"
connection_open()
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read = False Then
MsgBox("Record Does Not Exists!",
MsgBoxStyle.Critical, "Duplicate")
connection_close()
Else
If MsgBox("Are you sure you want to update?",
MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
'Updating Data
qry = "UPDATE Teachers SET StaffId = '" &
txtTeacherId.Text & "', Name = '" & txtTeacherFullName.Text & "', Gender
= '" & cmbTeacherGender.Text & "', Address = '" & txtTeacherAddress.Text
& "', PhNo = '" & txtTeacherPhoneNumber.Text & "', Email = '" &
txtTeacherEmail.Text & "', Salary = '" & txtTeacherSalary.Text & "',
Picture = '" & pictureTeacher.ImageLocation & "', Age = '" &
txtTeacherAge.Text & "' WHERE StaffId = '" & txtTeacherId.Text & "'"
connection_open()
qry1 = "SELECT * FROM Teachers WHERE StaffId = '"
& txtTeacherId.Text & "'"
cmd1 = New SqlCommand(qry1, cnn)
dr = cmd1.ExecuteReader
If dr.Read() = True Then
cmd = New SqlCommand(qry, cnn)
dr.Close()
cmd.ExecuteNonQuery()
MsgBox("Teacher Record Updated
Successfully!", MsgBoxStyle.Information, "Added Success")
connection_close()
End If
End If
End If
connection_close()
data_disp()
92
Catch ex As Exception
MsgBox("Invalid Inputs.", MsgBoxStyle.Critical)
End Try
End If
End Sub
End Try
End Sub
End Sub
End Try
End Sub
End Class
Manage_User_Form.vb
Imports System.Data.SqlClient
Imports System.Data
End If
ElseIf cmbUserType.Text = "Admin" Then
MsgBox("You're not allowed to delete Admin.",
MsgBoxStyle.Critical)
Else
MsgBox("Invalid User Type.", MsgBoxStyle.Critical)
End If
End Sub
97
da.SelectCommand = cmd
Using dt As New DataTable()
da.Fill(dt)
DataGridViewUser.DataSource = dt
End Using
End Using
End Sub
End If
connection_close()
data_disp()
ElseIf cmbUserType.Text = "Admin" Then
MsgBox("You're not allowed to update Admin here. Go to
Settings and then update.", MsgBoxStyle.Critical)
Else
MsgBox("Invalid User Type.", MsgBoxStyle.Critical)
End If
End Sub
End Sub
End Try
End Sub
End Class
99
Setting_Form.vb
Imports System.Data.SqlClient
Imports System.Data
connection_open()
qry = "UPDATE Login set UserName = '" &
txtNewUsername.Text & "' WHERE UserName = '" & txtOldUsername.Text & "'"
cmd = New SqlCommand(qry, cnn)
cmd.ExecuteNonQuery()
MsgBox("Username Changed Successfully",
MsgBoxStyle.Information, "Success")
connection_close()
Else
connection_close()
MsgBox("Old Username is Invalid",
MsgBoxStyle.Critical, "Not Change")
End If
End If
End If
End Sub
connection_open()
qry = "UPDATE Login set Password = '" &
txtNewPassword.Text & "' WHERE Password = '" & txtOldPassword.Text & "'
AND UserName = '" & Login_Form.txtUserName.Text & "'"
cmd = New SqlCommand(qry, cnn)
cmd.ExecuteNonQuery()
MsgBox("Password Changed Successfully",
MsgBoxStyle.Information, "Success")
connection_close()
Else
connection_close()
MsgBox("Old Password is Invalid", MsgBoxStyle.Critical,
"Not Change")
End If
End If
End Sub
Student_Dashboard_Form.vb
Imports System.Data.SqlClient
Imports System.Data
101
Public Class Student_Dashboard_Form
Dim ExamCompleted, ExamLeft, TotalExam, TotalSubjects As Integer
Dim RecentExamSubject As String
Dim RecentSubjectId As Integer
Public Sub ShowDashboardInfo()
Try
connection_close()
connection_open()
qry = "SELECT * FROM Students WHERE RegNo = '" &
Login_Form.txtUserName.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read Then
lblRegNo.Text = dr.Item("RegNo").ToString()
lblName.Text = dr.Item("Name").ToString()
lblClass.Text = dr.Item("Class").ToString()
lblStream.Text = dr.Item("Stream").ToString()
'lblSubject1.Text = dr.Item("Subject").ToString()
Else
MsgBox("Record Not Found. Try Again!")
End If
FindRecentExam()
lblSubject1.Text = RecentExamSubject
connection_close()
connection_open()
lblExamLeft.Text = ExamLeft
Catch ex As Exception
End Try
End Sub
Try
connection_close()
connection_open()
qry = "select Subject from Exam where id = '" &
RecentSubjectId & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
dr.Read()
RecentExamSubject = dr.Item("Subject")
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
104
AND Subject = '" & lblExamSubject1.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read = True Then
Student_Start_Exam_Form.ShowDialog()
Else
MsgBox("Questions Not Added Yet! Please Contact
Teacher.", MsgBoxStyle.Critical, "")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Student_Panel_Form.vb
Imports System.Data.SqlClient
Imports System.Data
With Student_Exam_Form
.TopLevel = False
panelCentre.Controls.Add(Student_Exam_Form)
.BringToFront()
.Show()
End With
End Sub
106
Private Sub Student_Pannel_Form_Load(sender As Object, e As
EventArgs) Handles MyBase.Load
Try
connection_close()
connection_open()
qry = "SELECT * FROM Students WHERE RegNo = '" &
Login_Form.txtUserName.Text & "'"
cmd = New SqlCommand(qry, cnn)
Dim dt As New DataTable()
Dim da As New SqlDataAdapter(cmd)
da.Fill(dt)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While dr.Read
picStudent.Image =
Image.FromFile(dr.Item("Picture").ToString)
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
With Student_Dashboard_Form
.TopLevel = False
panelCentre.Controls.Add(Student_Dashboard_Form)
.BringToFront()
.Show()
End With
End Sub
End Class
Student_Result_Form.vb
Imports System.Data.SqlClient
Imports System.Data
Student_Panel_Form.panelCentre.Controls.Add(Student_ResultAnalysis_Form)
.BringToFront()
.Show()
End With
Else
MsgBox("You Haven't Given The Exam Yet!",
MsgBoxStyle.Critical, "")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
111
qry = "SELECT * FROM Students WHERE RegNo = '" &
Login_Form.txtUserName.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read Then
lblRegNo.Text = dr.Item("RegNo").ToString()
lblName.Text = dr.Item("Name").ToString()
lblClass.Text = dr.Item("Class").ToString()
lblStream.Text = dr.Item("Stream").ToString()
ShowImage()
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Try
connection_close()
connection_open()
qry = "SELECT * FROM Result WHERE
RegNo = '" & Login_Form.txtUserName.Text & "' AND Subject =
'" & Student_Dashboard_Form.lblSubject1.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read Then
lblSubject.Text = dr.Item("Subject").ToString()
lblTotalQues.Text = dr.Item("TotalQues").ToString()
TotalQues = dr.Item("TotalQues")
lblTotalMarks.Text = dr.Item("TotalMarks").ToString()
TotalMarks = dr.Item("TotalMarks")
lblMarksScore.Text = dr.Item("MarksObtain").ToString()
MarksObtain = dr.Item("MarksObtain")
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
Correct = CountCorrectAns()
Wrong = CountWrongAns()
Skipped = CountSkippedQues()
Attempt = CountAttemptedQues()
112
lblCorrectAns.Text = Correct.ToString
lblWrongAns.Text = Wrong.ToString
lblQuesSkipped.Text = Skipped.ToString
lblQuesAttempted.Text = Attempt.ToString
End Sub
Student_Panel_Form.panelCentre.Controls.Add(Student_ResultAnalysis_Form)
.BringToFront()
.Show()
End With
End Sub
End Class
Student_ResultAnalysis_Form.vb
Imports System.Data.SqlClient
Imports System.Data
113
Public Class Student_ResultAnalysis_Form
Dim MaxQNo As Integer
Dim QuestionNo As Integer = 1
Dim CorrectAnswer, GivenAnswer As String
txtResultAnalysisOptionB.BackColor = Color.White
txtResultAnalysisOptionB.ForeColor = Color.Black
txtResultAnalysisOptionC.BackColor = Color.White
txtResultAnalysisOptionC.ForeColor = Color.Black
txtResultAnalysisOptionD.BackColor = Color.White
txtResultAnalysisOptionD.ForeColor = Color.Black
End Sub
115
Public Sub ColourOptBtn()
If CorrectAnswer = "Option (A)" Then
txtResultAnalysisOptionA.BackColor = Color.LimeGreen
txtResultAnalysisOptionA.ForeColor = Color.White
ElseIf CorrectAnswer = "Option (B)" Then
txtResultAnalysisOptionB.BackColor = Color.LimeGreen
txtResultAnalysisOptionB.ForeColor = Color.White
ElseIf CorrectAnswer = "Option (C)" Then
txtResultAnalysisOptionC.BackColor = Color.LimeGreen
txtResultAnalysisOptionC.ForeColor = Color.White
ElseIf CorrectAnswer = "Option (D)" Then
txtResultAnalysisOptionD.BackColor = Color.LimeGreen
txtResultAnalysisOptionD.ForeColor = Color.White
Else
txtResultAnalysisOptionA.BackColor = Color.White
txtResultAnalysisOptionA.ForeColor = Color.Black
txtResultAnalysisOptionB.BackColor = Color.White
txtResultAnalysisOptionB.ForeColor = Color.Black
txtResultAnalysisOptionC.BackColor = Color.White
txtResultAnalysisOptionC.ForeColor = Color.Black
txtResultAnalysisOptionD.BackColor = Color.White
txtResultAnalysisOptionD.ForeColor = Color.Black
End If
116
If GivenAnswer = "Option (A)" And CorrectAnswer = GivenAnswer
Then
txtResultAnalysisOptionA.BackColor = Color.LimeGreen
txtResultAnalysisOptionA.ForeColor = Color.White
ElseIf GivenAnswer = "Option (B)" And CorrectAnswer = GivenAnswer
Then
txtResultAnalysisOptionB.BackColor = Color.LimeGreen
txtResultAnalysisOptionB.ForeColor = Color.White
ElseIf GivenAnswer = "Option (C)" And CorrectAnswer = GivenAnswer
Then
txtResultAnalysisOptionC.BackColor = Color.LimeGreen
txtResultAnalysisOptionC.ForeColor = Color.White
ElseIf GivenAnswer = "Option (D)" And CorrectAnswer = GivenAnswer
Then
txtResultAnalysisOptionD.BackColor = Color.LimeGreen
txtResultAnalysisOptionD.ForeColor = Color.White
End If
End Sub
118
End Sub
Student_Panel_Form.panelCentre.Controls.Add(Student_Result_Form)
.BringToFront()
.Show()
End With
End Sub
End Class
Student_Start_Exam_Form.vb
Imports System.Data.SqlClient
Imports System.Data
126
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
If BtnQNo = MaxQNo Then
btnExit.BackColor = Color.Green
End If
End Sub
131
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
If QNo = MaxQNo Then
btnExit.BackColor = Color.Green
End If
End Sub
End Sub
Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles
btnNext.Click
If (CheckAns = "ok" And TempQNo < (QNo - 1)) Then
UpdateAns()
Else
Save_Answer()
End If
If QNo < MaxQNo Then
rdbtnOptionA.Checked = False
rdbtnOptionB.Checked = False
rdbtnOptionC.Checked = False
rdbtnOptionD.Checked = False
GivenAns = ""
If (CheckAns = "ok" And TempQNo < (QNo - 1)) Then
CheckAns = "not ok"
TempQNo += 1
ShowAns()
Else
TempQNo += 1
QNo = TempQNo
ShowQues()
CheckAns = "right"
End If
End If
End Sub
135
If dr.Read Then
CorrectAns = dr.Item("Answer")
GivenAns = dr.Item("GivenAnswer")
If GivenAns = CorrectAns Then
MarksCount += EachQuesMarks
End If
End If
Catch ex As Exception
MsgBox(ex.Message)
MsgBox("Error inside Calculate Marks.")
End Try
MinQNo += 1
End While
End Sub
Else
'Inserting Data
connection_close()
connection_open()
qry = "INSERT INTO AnswerSheet (RegNo, Class, Stream,
Subject, QuesNo, Question, OptionA, OptionB, OptionC, OptionD, Answer,
GivenAnswer)
VALUES ('" & lblRegNo.Text & "', '" & lblClass.Text & "',
'" & lblStream.Text & "', '" & lblSubject.Text & "', '" & txtQuesNo.Text
& "', '" & txtQuestion.Text & "', '" & rdbtnOptionA.Text & "', '" &
rdbtnOptionB.Text & "', '" & rdbtnOptionC.Text & "', '" &
rdbtnOptionD.Text & "', '" & lblAnswer.Text & "', '" & GivenAns & "')"
qry1 = "SELECT * FROM AnswerSheet WHERE RegNo = '" &
Login_Form.txtUserName.Text & "' AND Class = '" & lblClass.Text & "' AND
Stream = '" & lblStream.Text & "' AND Subject = '" & lblSubject.Text & "'
AND QuesNo = '" & txtQuesNo.Text & "'"
cmd1 = New SqlCommand(qry1, cnn)
dr = cmd1.ExecuteReader
If dr.Read() = False Then
cmd = New SqlCommand(qry, cnn)
dr.Close()
cmd.ExecuteNonQuery()
End If
End If
ColorQuesButton()
GivenAns = ""
connection_close()
End Sub
connection_close()
connection_open()
qry = "SELECT * FROM AnswerSheet WHERE RegNo = '" &
Login_Form.txtUserName.Text & "' AND Class = '" & lblClass.Text & "' AND
Stream = '" & lblStream.Text & "' AND Subject = '" & lblSubject.Text & "'
AND QuesNo = '" & txtQuesNo.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
If dr.Read = False Then
Else
'Updating Data
connection_close()
connection_open()
qry1 = "SELECT * FROM AnswerSheet WHERE RegNo = '" &
Login_Form.txtUserName.Text & "' AND Class = '" & lblClass.Text & "' AND
Stream = '" & lblStream.Text & "' AND Subject = '" & lblSubject.Text & "'
AND QuesNo = '" & txtQuesNo.Text & "'"
qry = "UPDATE AnswerSheet
SET RegNo = '" & Login_Form.txtUserName.Text & "'
, QuesNo = '" & txtQuesNo.Text & "'
, Class = '" & lblClass.Text & "'
, Stream = '" & lblStream.Text & "'
, Subject = '" & lblSubject.Text & "'
, Question = '" & txtQuestion.Text & "'
, OptionA = '" & rdbtnOptionA.Text & "'
, OptionB = '" & rdbtnOptionB.Text & "'
, OptionC = '" & rdbtnOptionC.Text & "'
, OptionD = '" & rdbtnOptionD.Text & "'
, Answer = '" & KnowAnsBeforeUpdate & "'
, GivenAnswer = '" & GivenAns & "'
WHERE RegNo = '" & Login_Form.txtUserName.Text & "'
AND Class = '" & lblClass.Text & "'
AND Stream = '" & lblStream.Text & "'
138
AND Subject = '" & lblSubject.Text & "'
AND QuesNo = '" & txtQuesNo.Text & "'"
139
Student_Panel_Form.panelCentre.Controls.Add(Student_Result_Form)
.BringToFront()
.Show()
End With
End Sub
Teacher_Dashboard_Form.vb
Imports System.Data.SqlClient
Imports System.Data
Teacher_Panel_Form.vb
Imports System.Data.SqlClient
Imports System.Data
Public Class Teacher_Panel_Form
Dim Gender, Picture As String
141
Private Sub Teacher_Pannel_Form_Load(sender As Object, e As
EventArgs) Handles MyBase.Load
Try
If cnn.State = 1 Then cnn.Close()
connection_open()
qry = "SELECT * FROM Teachers
WHERE StaffId = '" & Login_Form.txtUserName.Text & "'"
cmd = New SqlCommand(qry, cnn)
Dim dt As New DataTable()
Dim da As New SqlDataAdapter(cmd)
da.Fill(dt)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
If dr.Read = True Then
Gender = dr.Item("Gender").ToString
Picture = dr.Item("Picture").ToString
picTeacher.Image =
Image.FromFile(dr.Item("Picture").ToString)
End If
Catch ex As Exception
End Try
With Teacher_Dashboard_Form
.TopLevel = False
panelCentre.Controls.Add(Teacher_Dashboard_Form)
.BringToFront()
.Show()
End With
End Sub
With Teacher_Dashboard_Form
142
.TopLevel = False
panelCentre.Controls.Add(Teacher_Dashboard_Form)
.BringToFront()
.Show()
End With
End Sub
End Class
View_Result_Form.vb
Imports System.Data.SqlClient
Imports System.Data
143
Public Function MinRegNoValue()
connection_close()
connection_open()
qry = "SELECT MIN(RegNo) AS MinRegNo FROM Result
WHERE Class = '" & cmbViewResultClass.Text & "'
AND Stream = '" & cmbViewResultCourse.Text & "'
AND Subject = '" & cmbViewResultSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
dr = cmd.ExecuteReader
dr.Read()
Return dr.Item("MinRegNo")
End Function
Else
RegNo -= 1
End If
txtViewResultRegNo.Text = RegNo
CheckStudent()
End Sub
Else
RegNo += 1
End If
txtViewResultRegNo.Text = RegNo
CheckStudent()
End Sub
Correct = CountCorrectAns()
Wrong = CountWrongAns()
Skipped = CountSkippedQues()
Attempt = CountAttemptedQues()
lblCorrectAns.Text = Correct.ToString
lblWrongAns.Text = Wrong.ToString
lblQuesSkipped.Text = Skipped.ToString
lblQuesAttempted.Text = Attempt.ToString
End Sub
Public Sub ShowResult()
Try
147
connection_close()
connection_open()
qry = "SELECT * FROM Result
WHERE RegNo = '" & RegNo & "'
AND Class = '" & cmbViewResultClass.Text & "'
AND Stream = '" & cmbViewResultCourse.Text & "'
AND Subject = '" & cmbViewResultSubject.Text & "'"
cmd = New SqlCommand(qry, cnn)
Dim dt As New DataTable()
Dim da As New SqlDataAdapter(cmd)
da.Fill(dt)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
While dr.Read
'lblViewResultRegNo.Text = dr.GetString(1).ToString()
'RegNo = dr.Item("RegNo")
lblViewResultClass.Text = dr.GetString(2).ToString()
lblViewResultStream.Text = dr.GetString(3).ToString()
lblViewResultSubject.Text = dr.GetString(4).ToString()
lblViewResultTotalQues.Text =
dr.Item("TotalQues").ToString()
lblViewResultTotalMarks.Text =
dr.Item("TotalMarks").ToString()
TotalMarks = dr.Item("TotalMarks")
lblViewResultMarksScore.Text =
dr.Item("MarksObtain").ToString()
MarksObtain = dr.Item("MarksObtain")
StudentImageNameShow()
CalculateResult()
End While
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
149
Limitations of the project:-
• Machine dependent.
• Need to install Visual basic 2019, SQL server 2019, Microsoft SQL
Server management studio 2018 for running this software.
• In the future student can also be able to upload and download report.
• We can run the entire system in any operating system and also we have an
android application of this entire system.
• We will also see the entire system more interactive and also be able to give
statistics data.
150