You are on page 1of 74

COLLEGE MANAGEMENT SYSTEM

CHAPTER 1

Introduction to College Management System

1.1 Introduction
College management software is prepared to maintain the day to day operations in a leading
college. This software helps them to maintain the student and employee records. So the
maintain becomes easier. This is a general software serve the purpose of maintenance of
records in colleges. This software provides them very easier option to search for the student
details, his fee status. Attendance, test marks, test result etc.,

1.2 Purpose
The purpose of this document is to specify requirements and to give guidelines for the
development of above said projects.in particular it gives guidelines on how to prepare the
above said project.

This document is intended to be a practical guide for people who developing this application.

1.3 Scope
This is of generic type software, suitable to all colleges. This software has all the modules to
manage college transactions. Separate division is provided to maintain admission process.
Student management, Staff management, etc.,

1.4 Goal
The main goal of the application is to maintain the record of the college, this software is
helpful to the colleges to maintain the student and employee management.

Department of BCA 1
COLLEGE MANAGEMENT SYSTEM

CHAPTER 2

STRUCTURE OF THE PROJECT

2.1 Existing System:


At present in colleges all records maintained manually. There are thousands of students joining
each year. As the years goes then number of students also get increases, for the staff to
maintain all these students records is very tedious and time consuming. Update fee, test marks,
test result all these need to be done in time to achieve college management need to be recruit
more peoples. To solve this problem this project is prepared which help the management to
maintain the records accurately.
The existing system has some disadvantages. They are as below:

• Lack of security data.

• More man power.

• Its time consuming.

• Consumes large volume of pare work.

• Needs manual calculations.

• No direct role for the higher officials.

• Damage of machines due to lack of attention.

To avoid all these limitations and make the working more accurately the system needs to be
computerized in the effective manner

2.2 Proposed System:


In the proposed system all the parameter are considered to maintain neat and easier solutions.
In college to maintain all student records they need have more staff and also place to maintain
the records. Even maintained properly when ever required they are not available. To solve this
problem this program is designed. It serve the purpose of maintain records. Collecting
fee,announcing the test results. Etc.,

Department of BCA 2
COLLEGE MANAGEMENT SYSTEM

The main objective of the existing system is to provide a user friendly interface. The system,
which is proposed now computerized all the details that are maintained manually. Once the
details are fed into the computer there is no need for various persons to deal with separate
sections. Only a single person is enough to maintain all the reports. The security can also be
given as per the requirement of the user.

 Large volumes of data can be stored with case.

 Maintenance of file is flexible.

 Records stored are updated now and then.

 Stored data and procedures can be easily edited.

 Reports can be generated with case.

 Accurate calculations are made.

 Less manpower required

Department of BCA 3
COLLEGE MANAGEMENT SYSTEM

CHAPTER 3

SYSTEM REQUIREMENTS

3.1 HARDWARE REQUIREMENTS:


The hardware used here consists of:

Processor AMD A4-5000 APU

RAM 1 GB

Graphics 1.50 GHz

Quality 64-bit Screen

Resolution 1366* 768

Mouse Standard Optical

3.2 SOFTWARE REQUIREMENTS:


The software used here consists of:

Operating System : windows 7 and above

Developing Tool : MS visual Studio 2010

Front End (Design) : VB.NET

Back End (Database) : MS SQL server 2008

Department of BCA 4
COLLEGE MANAGEMENT SYSTEM

CHAPTER 4

FEASIBILITY STUDY

4.1 Economically Feasibility:

The system being developed is economic with respect to School or Collage’s point of view. It
is cost effective in the sense that has eliminated the paper work completely.

The system is also time effective because the calculations are automated which are made at the
end of the month or as per the user requirement.

The result obtained contains minimum errors and are highly accurate as the data is required.

4.2 Technical Feasibility:

The technical requirement for the system is economic and it does not use any other additional
Hardware and software.

4.3 Behavioral Feasibility:

The system working is quite easy to use and learn due to its simple but attractive interface.
User requires no special training for operating the system.

4.4 Working of Present System

In the present system all work is done on paper. The whole session attendance is stored in
register and at the end of the session the reports are generated. We are not interested in
generating report in the middle of the session or as per the requirement because it takes more
time in calculation. At the end of session the students who don’t have 75% attendance get a
notice.

Department of BCA 5
COLLEGE MANAGEMENT SYSTEM

4.5 Disadvantages of Present Working System:

• Not User Friendly: The existing system is not user friendly because the retrieval of data is
very slow and data is not maintained efficiently.

• Difficulty in report generating: We require more calculations to generate the report so it is


generated at the end of the session and the students do not get a single chance to improve their
attendance

• Manual control: All calculations to generate report is done manually so there is greater
chance of errors.

• Lots of paperwork: Existing system requires lot of paper work. Loss of even a single
register/record led to difficult situation because all the papers are needed to generate the
reports.

• Time consuming: Every work is done manually so we cannot generate report in the middle
of the session or as per the requirement because it is very time consuming.

CHAPTER 5

Department of BCA 6
COLLEGE MANAGEMENT SYSTEM

SOFTWARE REQUIREMENT SPECIFICATION


A software requirement specification (SRS) is a detailed description of a software system to be
developed with its functional and non-functional requirements. The SRS is developed based
the agreement between customer and contractors. It may include the use cases of how user is
going to interact with software system.

The software requirement specification document consistent of all necessary requirements


required for project development.

To develop the software system we should have clear understanding of Software system.

To achieve this we need to continuous communication with customers to gather all


requirements.

A good SRS defines the how Software System will interact with all internal modules,
hardware, communication with other programs and human user interactions with wide range of
real life scenarios.

Using the Software requirements specification (SRS) document on QA lead, managers creates
test plan. It is very important that testers must be cleared with every detail specified in this
document in order to avoid faults in test cases and its expected results.

It is highly recommended to review or test SRS documents before start writing test cases and
making any plan for testing.

CHAPTER 6

Department of BCA 7
COLLEGE MANAGEMENT SYSTEM

Characteristics of Proposed System


• User Friendly: The proposed system is user friendly because the retrieval and storing of data
is fast and data is maintained efficiently. Moreover the graphical user interface is provided in
the proposed system, which provides user to deal with the system very easily.

• Reports are easily generated: reports can be easily generated in the proposed system so user
can generate the report as per the requirement (monthly) or in the middle of the session. User
can give the notice to the students so he/she become regular.

• Very less paper work: The proposed system requires very less paper work. All the data is
feted into the computer immediately and reports can be generated through computers.
Moreover work become very easy because there is no need to keep data on papers.

• Computer operator control: Computer operator control will be there so no chance of errors.
Moreover storing and retrieving of information is easy.

CHAPTER 7

Department of BCA 8
COLLEGE MANAGEMENT SYSTEM

SDLC (Software Development Life Cycle)

Software Development Life Cycle (SDLC) is a process used by the software industry to


design, develop and test high quality softwares. The SDLC aims to produce a high quality
software that meets or exceeds customer expectations, reaches completion within times and
cost estimates.

The above figure tells us the 5 stages of software development life cycle.

CHAPTER 8

Department of BCA 9
COLLEGE MANAGEMENT SYSTEM

Data Tables

8.1 Attendance

Column Name Data Type


Date Varchar(50)
course Varchar(50)
Sem Varchar(50)
Sub Varchar(50)
Regno Varchar(50)
Name Varchar(50)
Attendance Varchar(50)

8.2 Course Details

Column Name Data Type


coursename Varchar(50)
couesedetails Varchar(50)

8.3 Exam Marks

Column Name Data Type


Examdate date
Course Varchar(50)
Sem Varchar(50)
Sub Varchar(50)
Regno Varchar(50)
Name Varchar(50)
marks1 Int
8.4 Login

Column Name Data Type


Username varchar(50)
Password varchar(50)

8.5 Fees collection

Column Name Data Type


regno Varchar(50)

Department of BCA 10
COLLEGE MANAGEMENT SYSTEM

stdname Varchar(50)
addmfees nchar(10)
tuitionfees nchar(10)
libraryfees nchar(10)
Sportsfees nchar(10)
othersfees nchar(10)
totalpaid nchar(10)
balamnt nchar(10)

8.6 Staff Details

Column Name Data Type


Staffcode varchar(50)
Staffname varchar(50)
Staffaddress varchar(50)
Pincode int
Staffphno char(10)
Staffmail varchar(50)
Staffqualification varchar(50)
Staffdesignation varchar(50)

8.7 Student Details

Column Name Data Type


regno varchar(50)
stdname varchar(50)
stdparent varchar(50)
Address varchar(50)
coursename varchar(50)
Sem varchar(50)

8.8 Subject Details

Column Name Data Type


course varchar(50)
sem varchar(50)
subshort varchar(50)
subfull varchar(50)

Department of BCA 11
COLLEGE MANAGEMENT SYSTEM

CHAPTER 9

Data flow diagram

Department of BCA 12
COLLEGE MANAGEMENT SYSTEM

CHAPTER 10

Entity Relation diagram

Department of BCA 13
COLLEGE MANAGEMENT SYSTEM

CHAPTER 11
SCREENSHOT OF FORM
Splash screen

Department of BCA 14
COLLEGE MANAGEMENT SYSTEM

Fig 1

Login Form

Fig 2

MDI form

Department of BCA 15
COLLEGE MANAGEMENT SYSTEM

Fig 3

Course details

Fig 4

Department of BCA 16
COLLEGE MANAGEMENT SYSTEM

Subject details

Fig 5

Staff details

Fig 6

Student details

Department of BCA 17
COLLEGE MANAGEMENT SYSTEM

Fig 7

Fees collection

Fig 8

Attendance

Department of BCA 18
COLLEGE MANAGEMENT SYSTEM

Fig 9

Exam marks entry

Fig 10

Staff list

Department of BCA 19
COLLEGE MANAGEMENT SYSTEM

Fig 11

Student list

Fig 12

Fees collection report

Department of BCA 20
COLLEGE MANAGEMENT SYSTEM

Fig 13

Exam result all

Fig 14

Exam result

Department of BCA 21
COLLEGE MANAGEMENT SYSTEM

Fig 15

CHAPTER 12

Department of BCA 22
COLLEGE MANAGEMENT SYSTEM

TESTING
"Testing is the process of analysing a software item to detect the differences between existing
and required conditions and to evalaute the features of software item". The system is tested
under adverse situations and environment to test its performance, reliability and robustness.
Verification and validation is done for the system and it is reviewed against each and every
customer requirement specification.

12.1 The main objective of testing are:


 Testing is a process of executing a program with the interest of finding an error.

 A good test is one that has high probability of finding the yet undiscovered errors.

 A successful test is the one that has high portability of finding the undiscovered errors.

 Tests designed to reflect the frequency of user inputs used for reliability estimation.

To test the process two classes of inputs are provided, they are:

a. A software configuration that includes a software requirement specification,a design


specification and source code.

b. A software configuration that includes a test plan and procedure,any testing tool and test
cases and their expected results.

Testing is performed to prove that there are no errors in program. This is extremely difficult
since designer cannot prove hundred percent accurate. Therefore, testing is done with a explicit
intension of finding errors that make the program fail. Testing has its own cycle. It requires 5
basic critical factors: planning, project and process management, risk management, measurement
tools.

12.2 Types of Testing:


Software testing is a critical element of software quality assurance and represents the ultimate
review of specification, design and code generation. There are three types of testing under which
a system is tested under different perspectives.they are:

1. White box testing


2. Black box testing
3. Alpha Testing
4. Beta testing
5. Clean Room testing
6. Defect Testing
12.2.1 White Box Testing:

Department of BCA 23
COLLEGE MANAGEMENT SYSTEM

This is a method of testing software that that tests internal structures or working of an
application,as opposed to its functionality. Internal program logic is excercised using this
technique. The tester chooses inputs to exercise paths through the code and determine the
appropriate outputs. This can be applied at the unit,integration and system levels of software
testing process.

White box test design techniques include the following code coverage criteria:

 control flow testing

 data flow testing

 branch testing

 statement coverage

 decision coverage

 prime path testing

 path testing

White box testing use these above criteria as guidelines to create an error free environment by
examining any fragile code. So these are the building blocks of white box testing. The whole
point of white box testing is the ability to know which line of the code is being executed and
being able to identify what the correct output should be.

12.2.2 Black box Testing:


Black box testing is a method of software testing that examines the functionality of an
application without peering into its internal structures and working.Software requirements are
exercised using this technique. This method can be applied to every level of software testing.

Typical black box test design techniques include:

Department of BCA 24
COLLEGE MANAGEMENT SYSTEM

 decision table testing

 all-pairs testing

 equivalence partitioning

 boundary value analysis

 cause - effect graph

 error guessing

 state transition

 user story testing

 domain analysis

 combining technique

Test cases are built around specifications and requirements. Although the tests used are
primarily functional in nature, non functional tests may also be used. The test designer selects
both valid and invalid inputs and determines the correct output.

12.3 Test Process:


The general testing process is the creation of a test stratergy, creation of test plan/design and the
execution of tests. Tests data are the inputs that have been divised tp test the system.

Stages in testing process are:

1. Unit Testing
2. Module Testing
3. Sub-System Testing
4. System Testing
5. Acceptance Testing

CHAPTER 13

Department of BCA 25
COLLEGE MANAGEMENT SYSTEM

VALIDATION
At the culmination of integration testing, software is completely assembled as a package,
interface error has been uncovered and corrected and final serves of software tests-validation
testing may begin. Validation can be defined in many ways. But a simple defination is that
validation succeeds when software function in a manner that can be reasonably expected by the
customer, software validation is achieved through a series of black box test that will be used to
demonstrate conformity with the requirements.

A test plan outlines the class tests that will be used to demonstrate the conformity with
requirements. Both the plan and procedure are designed to ensure that all the functional
requirements are satisfied. All the behavioral characteristics are achieved. All performance
requirements are attained documentation is correct and human engineering and other
requirements are met.

CHAPTER 14

Department of BCA 26
COLLEGE MANAGEMENT SYSTEM

SOURCE CODE
1) SPLASH SCREEN

Public Class Form1


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Timer1.Tick
i=i+1
If i > 5 Then
Timer1.Enabled = False
Me.Hide()
Login_Nishant.Show()
End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Me.Width = 759
Me.Height = 310
End Sub
End Class

2) LOGIN FORM

Imports System.Data.SqlClient

Public Class Login_Nishant

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtuser.TextChanged
End Sub

Private Sub loginbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles loginbtn.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd As New SqlCommand("select * from login where username= '" &
UCase(txtuser.Text) & "' and password='" & UCase(txtpsd.Text) & "' ", con)
Dim d1 As SqlDataReader = cmd.ExecuteReader()
If d1.HasRows Then
Me.Hide()
MDI_Parent.Show()

Else
MsgBox("Invalid Username or passsword")

Department of BCA 27
COLLEGE MANAGEMENT SYSTEM

End If
End Sub

Private Sub cancelbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles cancelbtn.Click
Me.Close()
End Sub

3) MDI FORM

Imports System.Windows.Forms
Public Class MDI_Parent
Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs)
Dim ChildForm As New System.Windows.Forms.Form
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "Window " & m_ChildFormNumber
ChildForm.Show()
End Sub

Private Sub OpenFile(ByVal sender As Object, ByVal e As EventArgs)


Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments
OpenFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"
If(OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then
Dim FileName As String = OpenFileDialog.FileName
End If
End Sub

Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.InitialDirectory =
My.Computer.FileSystem.SpecialDirectories.MyDocuments SaveFileDialog.Filter = "Text
Files (*.txt)|*.txt|All Files (*.*)|*.*"

If(SaveFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then


Dim FileName As String = SaveFileDialog.FileName
End If
End Sub

Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs)


Me.Close()
End Sub

Department of BCA 28
COLLEGE MANAGEMENT SYSTEM

Private Sub CascadeToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.Cascade)
End Sub

Private Sub TileVerticalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.TileVertical)
End Sub

Private Sub TileHorizontalToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.TileHorizontal)
End Sub

Private Sub ArrangeIconsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
Me.LayoutMdi(MdiLayout.ArrangeIcons)
End Sub

Private Sub CloseAllToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


EventArgs)
For Each ChildForm As Form In Me.MdiChildren
ChildForm.Close()
Next
End Sub

Private m_ChildFormNumber As Integer


Private Sub SubjectDetailsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SubjectDetailsToolStripMenuItem.Click
Subject_Details.MdiParent = Me
Subject_Details.Show()
End Sub

Private Sub CourseDetailsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles CourseDetailsToolStripMenuItem.Click
Course_Details.MdiParent = Me
Course_Details.Show()
End Sub

Private Sub StaffDetailsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles StaffDetailsToolStripMenuItem.Click

Staff_Details.MdiParent = Me
Staff_Details.Show()
End Sub

Department of BCA 29
COLLEGE MANAGEMENT SYSTEM

Private Sub StudentDetailsToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles StudentDetailsToolStripMenuItem.Click
Student_Details.MdiParent = Me
Student_Details.Show()
End Sub

Private Sub FeesCollectionToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles FeesCollectionToolStripMenuItem.Click
Fees_Collection.MdiParent = Me
Fees_Collection.Show()
End Sub

Private Sub AttendanceToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles AttendanceToolStripMenuItem.Click
Attendance.MdiParent = Me
Attendance.Show()
End Sub

Private Sub ExamMarksEntryToolStripMenuItem_Click(ByVal sender As Object, ByVal e As


System.EventArgs) Handles ExamMarksEntryToolStripMenuItem.Click
Exam_Marks_Entry.MdiParent = Me
Exam_Marks_Entry.Show()
End Sub

Private Sub FeesCollectionReportToolStripMenuItem_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles FeesCollectionReportToolStripMenuItem.Click
Fee_Collection_Report.MdiParent = Me
Fee_Collection_Report.Show()
End Sub

Private Sub StudentListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles StudentListToolStripMenuItem.Click
Student_List.MdiParent = Me
Student_List.Show()
End Sub

Private Sub ExamResultAllToolStripMenuItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles ExamResultAllToolStripMenuItem.Click
Exam_Result_All.MdiParent = Me

Exam_Result_All.Show()
End Sub

Private Sub ExamResultToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles ExamResultToolStripMenuItem.Click
Exam_Result.MdiParent = Me
Exam_Result.Show()

Department of BCA 30
COLLEGE MANAGEMENT SYSTEM

End Sub

Private Sub StaffListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles StaffListToolStripMenuItem.Click
Staff_List.MdiParent = Me
Staff_List.Show()
End Sub
End Class

4) COUSE DETAILS

Imports System.Data.SqlClient
Public Class Course_Details
Dim q1var, q2var As String
Dim pkvar As String
Private Sub Course_Details_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
newload()
End Sub

Sub newload()
newbtn.Enabled = True
savebtn.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
txtcourse.Enabled = False
txtdetails.Enabled = False
displaybtn.Enabled = True
End Sub

Private Sub newbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles newbtn.Click
newrecords()
End Sub

Sub newrecords()
savebtn.Enabled = True

newbtn.Enabled = False
txtcourse.Enabled = True
txtdetails.Enabled = True
modifybtn.Enabled = False
deletebtn.Enabled = False
txtcourse.Text = ""
txtdetails.Text = ""
End Sub

Department of BCA 31
COLLEGE MANAGEMENT SYSTEM

Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
saverecords()
newrecords()
newload()
End Sub

Sub saverecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd As New SqlCommand("Select coursename from course where coursename='"
& txtcourse.Text & "'", con)

Dim d1 As SqlDataReader = cmd.ExecuteReader()


If (txtcourse.Text = "" Or txtdetails.Text = "") Then
MsgBox("Feilds should not be empty")
txtcourse.Text = ""
txtdetails.Text = ""
Exit Sub
End If

If d1.HasRows Then
MsgBox("Data already exist")
Exit Sub
End If

If con.State = ConnectionState.Open Then con.Close()


con.Open()
q1var = "insert into course("
q2var = "values("
q1var = q1var & "coursename" & ","
q2var = q2var & "'" & txtcourse.Text & "',"
q1var = q1var & "coursedetails" & ")"
q2var = q2var & "'" & txtdetails.Text & "')"
MsgBox(q1var & q2var)
Dim cmd1 As New SqlCommand(q1var & q2var, con)
cmd1.ExecuteNonQuery()

If con.State = ConnectionState.Open Then con.Close()


txtcourse.Text = ""
txtdetails.Text = ""
newbtn.Enabled = True
savebtn.Enabled = False
End Sub

Department of BCA 32
COLLEGE MANAGEMENT SYSTEM

Private Sub modifybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles modifybtn.Click
If vbNo = MsgBox("Want to modify?", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from course where coursename='" & pkvar &
"'", con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
savebtn.Enabled = False
deletebtn.Enabled = False
saverecords()
txtcourse.Enabled = True
txtdetails.Enabled = True
modifybtn.Enabled = False
txtcourse.Enabled = False
txtdetails.Enabled = False
End Sub

Private Sub deletebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles deletebtn.Click
If vbNo = MsgBox("Do u want to delete", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from course Where coursename ='" & pkvar &
"'", con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
disRecords()
modifybtn.Enabled = False
txtcourse.Text = ""
txtdetails.Text = ""
modifybtn.Enabled = False
txtcourse.Enabled = False
txtdetails.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub displaybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles displaybtn.Click
disRecords()
newbtn.Enabled = True
deletebtn.Enabled = False
modifybtn.Enabled = False
txtcourse.Enabled = False
txtdetails.Enabled = False
End Sub

Department of BCA 33
COLLEGE MANAGEMENT SYSTEM

Sub disRecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim ds1 As New DataSet
Dim adp As New SqlDataAdapter("Select coursename,coursedetails From course order
by coursename", con)
adp.Fill(ds1)
dg1.DataSource = ds1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub dg1_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dg1.CellMouseClick
pkvar = dg1.CurrentRow.Cells(0).Value
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd0 As New SqlCommand("Select * From course Where coursename='" & pkvar
& "'", con)
Dim d1 As SqlDataReader = cmd0.ExecuteReader()
If d1.HasRows Then
d1.Read()
txtcourse.Text = d1(0).ToString
txtdetails.Text = d1(1).ToString
modifybtn.Enabled = True
deletebtn.Enabled = True
txtcourse.Enabled = True
txtdetails.Enabled = True
End If
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub
End Class

Department of BCA 34
COLLEGE MANAGEMENT SYSTEM

5) SUBJECCT DETAILS

Imports System.Data.SqlClient
Public Class Subject_Details
Dim q1var, q2var As String
Dim pkvar, pkvar2 As String

Private Sub Subject_Details_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
newload()
End Sub

Sub newload()
newbtn.Enabled = True
savebtn.Enabled = False
cmbcourse.Enabled = False
cmbsemester.Enabled = False
txtfullsub.Enabled = False
txtshortsub.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub newbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles newbtn.Click
newrecords()
End Sub

Sub newrecords()
savebtn.Enabled = True
newbtn.Enabled = False
cmbcourse.Enabled = True
cmbsemester.Enabled = True
txtfullsub.Enabled = True
txtshortsub.Enabled = True
modifybtn.Enabled = False
deletebtn.Enabled = False
txtfullsub.Text = ""
txtshortsub.Text = ""
cmbcourse.ResetText()
cmbsemester.ResetText()
End Sub

Department of BCA 35
COLLEGE MANAGEMENT SYSTEM

Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
saverecords()
newrecords()
newload()
End Sub

Sub saverecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd As New SqlCommand("Select subfull from subject_details where subfull='" &
txtfullsub.Text & "'and subshort='" & txtshortsub.Text & "'", con)
Dim d1 As SqlDataReader = cmd.ExecuteReader()
If d1.HasRows Then
MsgBox("Data already exist")
Exit Sub
End If

If txtfullsub.Text = "" Or txtshortsub.Text = "" Or cmbcourse.Text = "" Or cmbsemester.Text


= "" Then
MsgBox("Fields should not be left empty!")
Exit Sub
End If

If con.State = ConnectionState.Open Then con.Close()


con.Open()
q1var = "insert into subject_details("
q2var = "values("
q1var = q1var & "coursename" & ","
q2var = q2var & "'" & cmbcourse.Text & "',"
q1var = q1var & "semester" & ","
q2var = q2var & "'" & cmbsemester.Text & "',"
q1var = q1var & "subshort" & ","
q2var = q2var & "'" & txtshortsub.Text & "',"
q1var = q1var & "subfull" & ")"
q2var = q2var & "'" & txtfullsub.Text & "')"
MsgBox(q1var & q2var)

Dim cmd1 As New SqlCommand(q1var & q2var, con)


cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
txtfullsub.Text = ""
txtshortsub.Text = ""
newbtn.Enabled = True
savebtn.Enabled = False
End Sub

Department of BCA 36
COLLEGE MANAGEMENT SYSTEM

Private Sub modifybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles modifybtn.Click
If vbNo = MsgBox("Want to modify?", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from subject_details where subfull='" & pkvar
& "' and subshort ='" & pkvar2 & "'", con)

cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
saverecords()
txtfullsub.Text = ""
txtshortsub.Text = ""
modifybtn.Enabled = False
deletebtn.Enabled = False
savebtn.Enabled = False
cmbcourse.ResetText()
cmbsemester.ResetText()
txtfullsub.Enabled = False
txtshortsub.Enabled = False
cmbcourse.Enabled = False
cmbsemester.Enabled = False
End Sub

Private Sub deletebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles deletebtn.Click
If vbNo = MsgBox("Do u want to delete", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from subject_details Where subfull ='" & pkvar
& "'", con)

cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
disRecords()
txtshortsub.Text = ""
txtfullsub.Text = ""
savebtn.Enabled = False
modifybtn.Enabled = False
cmbcourse.ResetText()
cmbsemester.ResetText()
modifybtn.Enabled = False
txtfullsub.Enabled = False
txtshortsub.Enabled = False
cmbcourse.Enabled = False

cmbsemester.Enabled = False
deletebtn.Enabled = False

Department of BCA 37
COLLEGE MANAGEMENT SYSTEM

End Sub

Private Sub listbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles listbtn.Click
savebtn.Enabled = False
newbtn.Enabled = True
cmbcourse.Enabled = False
cmbsemester.Enabled = False
txtfullsub.Enabled = False
txtshortsub.Enabled = False
disRecords()
cmbsemester.ResetText()
cmbcourse.ResetText()
End Sub

Sub disRecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim ds1 As New DataSet
Dim adp As New SqlDataAdapter("Select coursename,semester,subshort,subfull From
subject_details order by coursename", con)
adp.Fill(ds1)
dg1.DataSource = ds1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub dg1_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dg1.CellMouseClick
pkvar2 = dg1.CurrentRow.Cells(2).Value
pkvar = dg1.CurrentRow.Cells(3).Value
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd0 As New SqlCommand("Select * From subject_details Where subfull ='" &
pkvar & "' and subshort ='" & pkvar2 & "'", con)
Dim d1 As SqlDataReader = cmd0.ExecuteReader()
If d1.HasRows Then
d1.Read()
cmbcourse.Text = d1(0).ToString
cmbsemester.Text = d1(1).ToString
txtshortsub.Text = d1(2).ToString
txtfullsub.Text = d1(3).ToString
modifybtn.Enabled = True
deletebtn.Enabled = True

Department of BCA 38
COLLEGE MANAGEMENT SYSTEM

cmbcourse.Enabled = True
cmbsemester.Enabled = True
txtfullsub.Enabled = True
txtshortsub.Enabled = True
If con.State = ConnectionState.Open Then con.Close()
End If
End Sub
End Class

6) STAFF DETAILS

Imports System.Data.SqlClient
Public Class Staff_Details
Dim q1var, q2var As String
Dim pkvar As String

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
saverecords()
newrecords()
newload()
End Sub

Sub saverecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd As New SqlCommand("Select * from staff_details where staffcode='" &
txtstaffcode.Text & "' ", con)

Dim d1 As SqlDataReader = cmd.ExecuteReader()


If (txtstaffcode.Text = "" Or txtstaffname.Text = "" Or txtstaffaddress.Text = "" Or
txtpincode.Text = "" Or txtstaffmail.Text = "" Or txtstaffphno.Text = "" Or
cmbqualification.Text = "" Or cmbdesignation.Text = "") Then
MsgBox("Feilds should not be empty,Please enter all the feilds")
txtstaffcode.Text = ""
txtstaffname.Text = ""
txtstaffaddress.Text = ""
txtpincode.Text = ""
txtstaffmail.Text = ""
txtstaffphno.Text = ""
cmbqualification.Text = ""
cmbdesignation.Text = ""

Exit Sub
End If

If d1.HasRows Then

Department of BCA 39
COLLEGE MANAGEMENT SYSTEM

MsgBox("Data already exist")


Exit Sub
End If
If con.State = ConnectionState.Open Then con.Close()
con.Open()
q1var = "insert into staff_details("
q2var = "values("
q1var = q1var & "staffcode" & ","
q2var = q2var & "'" & txtstaffcode.Text & "',"
q1var = q1var & "staffname" & ","
q2var = q2var & "'" & txtstaffname.Text & "',"
q1var = q1var & "staffaddress" & ","
q2var = q2var & "'" & txtstaffaddress.Text & "',"
q1var = q1var & "pincode" & ","
q2var = q2var & "'" & txtpincode.Text & "',"
q1var = q1var & "staffphno" & ","
q2var = q2var & "'" & txtstaffphno.Text & "',"
q1var = q1var & "staffmail" & ","
q2var = q2var & "'" & txtstaffmail.Text & "',"
q1var = q1var & "staffqualification" & ","
q2var = q2var & "'" & cmbqualification.Text & "',"
q1var = q1var & "staffdesignation" & ")"
q2var = q2var & "'" & cmbdesignation.Text & "')"
MsgBox(q1var & q2var)
Dim cmd1 As New SqlCommand(q1var & q2var, con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
cmbdesignation.ResetText()
cmbqualification.ResetText()
End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles deletebtn.Click
If vbNo = MsgBox("Do u want to delete", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from staff_details Where staffcode ='" & pkvar
& "'", con)
cmd1.ExecuteNonQuery()

If con.State = ConnectionState.Open Then con.Close()

disRecords()
txtstaffcode.Text = ""
txtstaffname.Text = ""
txtstaffaddress.Text = ""
txtpincode.Text = ""

Department of BCA 40
COLLEGE MANAGEMENT SYSTEM

txtstaffmail.Text = ""
txtstaffphno.Text = ""
savebtn.Enabled = False
cmbdesignation.ResetText()
cmbqualification.ResetText()
modifybtn.Enabled = False
txtstaffcode.Enabled = False
txtstaffname.Enabled = False
txtstaffaddress.Enabled = False
txtpincode.Enabled = False
txtstaffphno.Enabled = False
txtstaffmail.Enabled = False
cmbdesignation.Enabled = False
cmbqualification.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles newbtn.Click
newrecords()
End Sub

Sub newrecords()
savebtn.Enabled = True
newbtn.Enabled = False
cmbqualification.Enabled = True
cmbdesignation.Enabled = True
txtstaffcode.Enabled = True
txtstaffname.Enabled = True
txtstaffaddress.Enabled = True
txtpincode.Enabled = True
txtstaffphno.Enabled = True
txtstaffmail.Enabled = True
modifybtn.Enabled = False
deletebtn.Enabled = False
txtstaffcode.Text = ""
txtstaffname.Text = ""
txtstaffaddress.Text = ""
txtpincode.Text = ""
txtstaffphno.Text = ""
txtstaffmail.Text = ""

cmbdesignation.ResetText()
cmbqualification.ResetText()
End Sub

Department of BCA 41
COLLEGE MANAGEMENT SYSTEM

Private Sub listbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles listbtn.Click
disRecords()
savebtn.Enabled = False
newbtn.Enabled = True
cmbqualification.Enabled = False
cmbdesignation.Enabled = False
txtstaffcode.Enabled = False
txtstaffname.Enabled = False
txtstaffaddress.Enabled = False
txtpincode.Enabled = False
txtstaffphno.Enabled = False
txtstaffmail.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
cmbdesignation.ResetText()
cmbqualification.ResetText()
End Sub

Sub disRecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim ds1 As New DataSet
Dim adp As New SqlDataAdapter("Select
staffcode,staffname,staffaddress,pincode,staffphno,staffmail,staffqualification,staffdesignation
From staff_details order by staffcode", con)
adp.Fill(ds1)
dg1.DataSource = ds1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub Staff_Details_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
newload()
End Sub

Sub newload()
savebtn.Enabled = False
newbtn.Enabled = True
cmbqualification.Enabled = False

cmbdesignation.Enabled = False
txtstaffcode.Enabled = False
txtstaffname.Enabled = False
txtstaffaddress.Enabled = False
txtpincode.Enabled = False

Department of BCA 42
COLLEGE MANAGEMENT SYSTEM

txtstaffphno.Enabled = False
txtstaffmail.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub modifybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles modifybtn.Click
If vbNo = MsgBox("Want to modify?", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from staff_details where staffcode='" & pkvar
& "'", con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
saverecords()
txtstaffcode.Text = ""
txtstaffname.Text = ""
txtstaffaddress.Text = ""
txtpincode.Text = ""
txtstaffphno.Text = ""
txtstaffmail.Text = ""
modifybtn.Enabled = False
deletebtn.Enabled = False
savebtn.Enabled = False
cmbdesignation.ResetText()
cmbqualification.ResetText()
txtstaffcode.Enabled = False
txtstaffname.Enabled = False
txtstaffaddress.Enabled = False
txtpincode.Enabled = False
txtstaffphno.Enabled = False
txtstaffmail.Enabled = False
cmbdesignation.Enabled = False
cmbqualification.Enabled = False
End Sub

Private Sub dg1_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dg1.CellMouseClick
pkvar = dg1.CurrentRow.Cells(0).Value
If con.State = ConnectionState.Open Then con.Close()
con.Open()

Department of BCA 43
COLLEGE MANAGEMENT SYSTEM

Dim cmd0 As New SqlCommand("Select * From staff_details Where staffcode='" &


pkvar & "'", con)
Dim d1 As SqlDataReader = cmd0.ExecuteReader()
If d1.HasRows Then
d1.Read()
txtstaffcode.Text = d1(0).ToString
txtstaffname.Text = d1(1).ToString
txtstaffaddress.Text = d1(2).ToString
txtpincode.Text = d1(3).ToString
txtstaffphno.Text = d1(4).ToString
txtstaffmail.Text = d1(5).ToString
cmbqualification.Text = d1(6).ToString
cmbdesignation.Text = d1(7).ToString
modifybtn.Enabled = True
deletebtn.Enabled = True
cmbqualification.Enabled = True
cmbdesignation.Enabled = True
txtstaffcode.Enabled = True
txtstaffname.Enabled = True
txtstaffaddress.Enabled = True
txtpincode.Enabled = True
txtstaffphno.Enabled = True
txtstaffmail.Enabled = True
If con.State = ConnectionState.Open Then con.Close()
End If
End Sub

Private Sub txtpincode_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtpincode.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txtstaffphno_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtstaffphno.KeyPress
If txtstaffphno.Text.Length >= 10 Then
If e.KeyChar <> ControlChars.Back Then
MsgBox("Enter 10 Digit Number only!")

e.Handled = True
End If
End If

If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then

Department of BCA 44
COLLEGE MANAGEMENT SYSTEM

MsgBox("Enter Number only!")


e.Handled = True
End If
End Sub
End Class

7) STUDENT DETAILS

Imports System.Data.SqlClient
Public Class Subject_Details
Dim q1var, q2var As String
Dim pkvar, pkvar2 As String

Private Sub Subject_Details_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
newload()
End Sub

Sub newload()
newbtn.Enabled = True
savebtn.Enabled = False
cmbcourse.Enabled = False
cmbsemester.Enabled = False
txtfullsub.Enabled = False
txtshortsub.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub newbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles newbtn.Click
newrecords()
End Sub

Sub newrecords()
savebtn.Enabled = True
newbtn.Enabled = False
cmbcourse.Enabled = True

cmbsemester.Enabled = True
txtfullsub.Enabled = True
txtshortsub.Enabled = True
modifybtn.Enabled = False
deletebtn.Enabled = False
txtfullsub.Text = ""

Department of BCA 45
COLLEGE MANAGEMENT SYSTEM

txtshortsub.Text = ""
cmbcourse.ResetText()
cmbsemester.ResetText()
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
saverecords()
newrecords()
newload()
End Sub

Sub saverecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd As New SqlCommand("Select subfull from subject_details where subfull='" &
txtfullsub.Text & "'and subshort='" & txtshortsub.Text & "'", con)

Dim d1 As SqlDataReader = cmd.ExecuteReader()


If d1.HasRows Then
MsgBox("Data already exist")
Exit Sub
End If
If txtfullsub.Text = "" Or txtshortsub.Text = "" Or cmbcourse.Text = "" Or cmbsemester.Text
= "" Then
MsgBox("Fields should not be left empty!")
Exit Sub
End If
If con.State = ConnectionState.Open Then con.Close()
con.Open()
q1var = "insert into subject_details("
q2var = "values("
q1var = q1var & "coursename" & ","
q2var = q2var & "'" & cmbcourse.Text & "',"
q1var = q1var & "semester" & ","
q2var = q2var & "'" & cmbsemester.Text & "',"
q1var = q1var & "subshort" & ","
q2var = q2var & "'" & txtshortsub.Text & "',"
q1var = q1var & "subfull" & ")"
q2var = q2var & "'" & txtfullsub.Text & "')"
MsgBox(q1var & q2var)

Dim cmd1 As New SqlCommand(q1var & q2var, con)


cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
txtfullsub.Text = ""
txtshortsub.Text = ""
newbtn.Enabled = True

Department of BCA 46
COLLEGE MANAGEMENT SYSTEM

savebtn.Enabled = False
End Sub

Private Sub modifybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles modifybtn.Click
If vbNo = MsgBox("Want to modify?", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from subject_details where subfull='" & pkvar
& "' and subshort ='" & pkvar2 & "'", con)

cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
saverecords()
txtfullsub.Text = ""
txtshortsub.Text = ""
modifybtn.Enabled = False
deletebtn.Enabled = False
savebtn.Enabled = False
cmbcourse.ResetText()
cmbsemester.ResetText()
txtfullsub.Enabled = False
txtshortsub.Enabled = False
cmbcourse.Enabled = False
cmbsemester.Enabled = False
End Sub

Private Sub deletebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles deletebtn.Click
If vbNo = MsgBox("Do u want to delete", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from subject_details Where subfull ='" & pkvar
& "'", con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
disRecords()
txtshortsub.Text = ""
txtfullsub.Text = ""

savebtn.Enabled = False
modifybtn.Enabled = False
cmbcourse.ResetText()
cmbsemester.ResetText()
modifybtn.Enabled = False
txtfullsub.Enabled = False
txtshortsub.Enabled = False
cmbcourse.Enabled = False

Department of BCA 47
COLLEGE MANAGEMENT SYSTEM

cmbsemester.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub listbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles listbtn.Click
savebtn.Enabled = False
newbtn.Enabled = True
cmbcourse.Enabled = False
cmbsemester.Enabled = False
txtfullsub.Enabled = False
txtshortsub.Enabled = False
disRecords()
cmbsemester.ResetText()
cmbcourse.ResetText()
End Sub

Sub disRecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim ds1 As New DataSet
Dim adp As New SqlDataAdapter("Select coursename,semester,subshort,subfull From
subject_details order by coursename", con)
adp.Fill(ds1)
dg1.DataSource = ds1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub dg1_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dg1.CellMouseClick

pkvar2 = dg1.CurrentRow.Cells(2).Value
pkvar = dg1.CurrentRow.Cells(3).Value
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd0 As New SqlCommand("Select * From subject_details Where subfull ='" &
pkvar & "' and subshort ='" & pkvar2 & "'", con)
Dim d1 As SqlDataReader = cmd0.ExecuteReader()
If d1.HasRows Then
d1.Read()
cmbcourse.Text = d1(0).ToString

Department of BCA 48
COLLEGE MANAGEMENT SYSTEM

cmbsemester.Text = d1(1).ToString
txtshortsub.Text = d1(2).ToString
txtfullsub.Text = d1(3).ToString
modifybtn.Enabled = True
deletebtn.Enabled = True
cmbcourse.Enabled = True
cmbsemester.Enabled = True
txtfullsub.Enabled = True
txtshortsub.Enabled = True
If con.State = ConnectionState.Open Then con.Close()
End If
End Sub
End Class

8) FEES COLLECTION

Imports System.Data.SqlClient
Public Class Fees_Collection
Dim q1var, q2var As String
Dim pkvar As String
Dim sum As String

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles totalbtn.Click
totalfee()
End Sub
Sub totalfee()
txttotalpaid.Text = Val(txtadmissionfees.Text) + Val(txttutionfees.Text) +
Val(txtlibraryfees.Text) + Val(txtsportsfees.Text) + Val(txtotherfees.Text)
txtbalamt.Text = Val(txttotalfees.Text) - Val(txttotalpaid.Text)
If (cmbcourse.Text = "" Or txtregno.Text = "" Or txtname.Text = "" Or
txtadmissionfees.Text = "" Or txttutionfees.Text = "" Or txtlibraryfees.Text = "" Or
txtsportsfees.Text = "" Or txtotherfees.Text = "" Or txttotalfees.Text = "" Or txttotalpaid.Text
= "" Or txtbalamt.Text = "") Then
cmbcourse.Text = ""

txtregno.Text = ""
txtname.Text = ""
txtadmissionfees.Text = ""
txttutionfees.Text = ""
txtlibraryfees.Text = ""
txtsportsfees.Text = ""
txtotherfees.Text = ""
txttotalfees.Text = ""
txttotalpaid.Text = ""
txtbalamt.Text = ""

Department of BCA 49
COLLEGE MANAGEMENT SYSTEM

MsgBox("Feild Should not empty")


Exit Sub
End If
End Sub

Private Sub Fees_Collection_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
newload()
End Sub

Sub newload()
savebtn.Enabled = False
newbtn.Enabled = True
cmbcourse.Enabled = False
txtregno.Enabled = False
txtname.Enabled = False
txttotalfees.Enabled = False
txtadmissionfees.Enabled = False
txttutionfees.Enabled = False
txtlibraryfees.Enabled = False
txtsportsfees.Enabled = False
txtotherfees.Enabled = False
txttotalpaid.Enabled = False
txtbalamt.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub newbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles newbtn.Click
newrecords()
End Sub

Sub newrecords()
savebtn.Enabled = True

newbtn.Enabled = False
cmbcourse.Enabled = True
txtregno.Enabled = True
txtname.Enabled = True
txttotalfees.Enabled = True
txtadmissionfees.Enabled = True
txttutionfees.Enabled = True
txtlibraryfees.Enabled = True
txtsportsfees.Enabled = True
txtotherfees.Enabled = True

Department of BCA 50
COLLEGE MANAGEMENT SYSTEM

txttotalpaid.Enabled = False
txtbalamt.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
txtregno.Text = ""
txtname.Text = ""
txttotalfees.Text = ""
txtadmissionfees.Text = ""
txttutionfees.Text = ""
txtlibraryfees.Text = ""
txtsportsfees.Text = ""
txtotherfees.Text = ""
txttotalpaid.Text = ""
txtbalamt.Text = ""
cmbcourse.ResetText()
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
saverecords()
newrecords()
newload()
End Sub

Sub saverecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd As New SqlCommand("Select * from fees_collection where regno='" &
txtregno.Text & "' ", con)

Dim d1 As SqlDataReader = cmd.ExecuteReader()


If (txtregno.Text = "" Or txtname.Text = "" Or txttotalfees.Text = "" Or
txtadmissionfees.Text = "" Or txttutionfees.Text = "" Or txtlibraryfees.Text = "" Or
txtsportsfees.Text = "" Or txtotherfees.Text = "" Or txttotalpaid.Text = "" Or txttotalpaid.Text
= "" Or txtbalamt.Text = "") Then

MsgBox("Feilds should not be empty,Please enter all the feilds")

txtregno.Text = ""
txtname.Text = ""
txttotalfees.Text = ""
txtadmissionfees.Text = ""
txttutionfees.Text = ""
txtlibraryfees.Text = ""
txtsportsfees.Text = ""
txtotherfees.Text = ""
txttotalpaid.Text = ""
txttotalpaid.Text = ""

Department of BCA 51
COLLEGE MANAGEMENT SYSTEM

txtbalamt.Text = ""
Exit Sub
End If
If d1.HasRows Then
MsgBox("Data already exist")
Exit Sub
End If
If con.State = ConnectionState.Open Then con.Close()
con.Open()
q1var = "insert into fees_collection("
q2var = "values("
q1var = q1var & "coursename" & ","
q2var = q2var & "'" & cmbcourse.Text & "',"
q1var = q1var & "regno" & ","
q2var = q2var & "'" & txtregno.Text & "',"
q1var = q1var & "stdname" & ","
q2var = q2var & "'" & txtname.Text & "',"
q1var = q1var & "totalfees" & ","
q2var = q2var & "'" & txttotalfees.Text & "',"
q1var = q1var & "addmfees" & ","
q2var = q2var & "'" & txtadmissionfees.Text & "',"
q1var = q1var & "tutionfees" & ","
q2var = q2var & "'" & txttutionfees.Text & "',"
q1var = q1var & "libfees" & ","
q2var = q2var & "'" & txtlibraryfees.Text & "',"
q1var = q1var & "sportsfees" & ","
q2var = q2var & "'" & txtsportsfees.Text & "',"
q1var = q1var & "otherfees" & ","
q2var = q2var & "'" & txtotherfees.Text & "',"
q1var = q1var & "totalpaid" & ","
q2var = q2var & "'" & txttotalpaid.Text & "',"
q1var = q1var & "balamt" & ")"
q2var = q2var & "'" & txtbalamt.Text & "')"
MsgBox(q1var & q2var)
Dim cmd1 As New SqlCommand(q1var & q2var, con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()

cmbcourse.ResetText()
End Sub

Private Sub modifybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles modifybtn.Click
totalfee()
modify()
End Sub
Sub modify()
If vbNo = MsgBox("Want to modify?", MsgBoxStyle.YesNo, "Delete") Then Exit Sub

Department of BCA 52
COLLEGE MANAGEMENT SYSTEM

If con.State = ConnectionState.Open Then con.Close()


con.Open()
Dim cmd1 As New SqlCommand("Delete from fees_collection where regno='" & pkvar
& "'", con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
saverecords()
txtregno.Text = ""
txtname.Text = ""
txttotalfees.Text = ""
txtadmissionfees.Text = ""
txttutionfees.Text = ""
txtlibraryfees.Text = ""
txtsportsfees.Text = ""
txtotherfees.Text = ""
txttotalpaid.Enabled = False
txttotalpaid.Text = ""
txtbalamt.Text = ""
modifybtn.Enabled = False
deletebtn.Enabled = False
savebtn.Enabled = False
cmbcourse.ResetText()
cmbcourse.Enabled = False
txtregno.Enabled = False
txtname.Enabled = False
txttotalfees.Enabled = False
txtadmissionfees.Enabled = False
txttutionfees.Enabled = False
txtlibraryfees.Enabled = False
txtsportsfees.Enabled = False
txtotherfees.Enabled = False
txttotalpaid.Enabled = False
txtbalamt.Enabled = False
End Sub

Private Sub deletebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles deletebtn.Click
If vbNo = MsgBox("Do u want to delete", MsgBoxStyle.YesNo, "Delete") Then Exit Sub
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand("Delete from fees_collection Where regno ='" & pkvar
& "'", con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
disRecords()
txtregno.Text = ""

Department of BCA 53
COLLEGE MANAGEMENT SYSTEM

txtname.Text = ""
txttotalfees.Text = ""
txtadmissionfees.Text = ""
txttutionfees.Text = ""
txtlibraryfees.Text = ""
txtsportsfees.Text = ""
txtotherfees.Text = ""
txttotalpaid.Enabled = False
txttotalpaid.Text = ""
txtbalamt.Text = ""
savebtn.Enabled = False
cmbcourse.ResetText()
modifybtn.Enabled = False
cmbcourse.Enabled = False
txtregno.Enabled = False
txtname.Enabled = False
txttotalfees.Enabled = False
txtadmissionfees.Enabled = False
txttutionfees.Enabled = False
txtlibraryfees.Enabled = False
txtsportsfees.Enabled = False
txtotherfees.Enabled = False
txttotalpaid.Enabled = False
txtbalamt.Enabled = False
deletebtn.Enabled = False
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub listbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles listbtn.Click
disRecords()

savebtn.Enabled = False
newbtn.Enabled = True
cmbcourse.Enabled = False
txtregno.Enabled = False
txtname.Enabled = False
txttotalfees.Enabled = False
txtadmissionfees.Enabled = False
txttutionfees.Enabled = False
txtlibraryfees.Enabled = False
txtsportsfees.Enabled = False
txtotherfees.Enabled = False
txttotalpaid.Enabled = False

Department of BCA 54
COLLEGE MANAGEMENT SYSTEM

txtbalamt.Enabled = False
modifybtn.Enabled = False
deletebtn.Enabled = False
cmbcourse.ResetText()
End Sub

Sub disRecords()
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim ds1 As New DataSet
Dim adp As New SqlDataAdapter("Select
coursename,regno,stdname,totalfees,addmfees,tutionfees,libfees,sportsfees,otherfees,totalpaid,
balamt From fees_collection order by regno", con)
adp.Fill(ds1)
dg1.DataSource = ds1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub dg1_CellMouseClick(ByVal sender As Object, ByVal e As


System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles dg1.CellMouseClick
pkvar = dg1.CurrentRow.Cells(1).Value
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd0 As New SqlCommand("Select * From fees_collection Where regno='" &
pkvar & "'", con)
Dim d1 As SqlDataReader = cmd0.ExecuteReader()
If d1.HasRows Then
d1.Read()
cmbcourse.Text = d1(0).ToString
txtregno.Text = d1(1).ToString
txtname.Text = d1(2).ToString
txttotalfees.Text = d1(3).ToString
txtadmissionfees.Text = d1(4).ToString
txttutionfees.Text = d1(5).ToString

txtlibraryfees.Text = d1(6).ToString
txtsportsfees.Text = d1(7).ToString
txtotherfees.Text = d1(8).ToString
txttotalpaid.Text = d1(9).ToString
txtbalamt.Text = d1(10).ToString
cmbcourse.Enabled = True
txtregno.Enabled = True
txtname.Enabled = True
txttotalfees.Enabled = True
txtadmissionfees.Enabled = True
txttutionfees.Enabled = True
txtlibraryfees.Enabled = True
txtsportsfees.Enabled = True

Department of BCA 55
COLLEGE MANAGEMENT SYSTEM

txtotherfees.Enabled = True
txttotalpaid.Enabled = False
txtbalamt.Enabled = False
modifybtn.Enabled = True
deletebtn.Enabled = True
If con.State = ConnectionState.Open Then con.Close()
End If
End Sub

Private Sub txttotalfees_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txttotalfees.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txtadmissionfees_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtadmissionfees.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txttutionfees_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txttutionfees.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If

End Sub

Private Sub txtlibraryfees_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtlibraryfees.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txtsportsfees_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtsportsfees.KeyPress

Department of BCA 56
COLLEGE MANAGEMENT SYSTEM

If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txtotherfees_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtotherfees.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txttotalpaid_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txttotalpaid.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub

Private Sub txtbalamt_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtbalamt.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back
Then
MsgBox("Enter Number only!")
e.Handled = True
End If
End Sub
End Class

9) ATTENDANCE

Imports System.Data.SqlClient
Public Class Attendance
Dim q1var, q2var As String
Dim pkvar, pkvar2 As String
Private Sub Attendance_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
If con.State = ConnectionState.Open Then con.Close()
con.Open()

Department of BCA 57
COLLEGE MANAGEMENT SYSTEM

Dim Cmd1 As New SqlCommand("select coursename from courseTab order by


coursename", con)
Dim D1 As SqlDataReader = Cmd1.ExecuteReader()
While D1.Read
ComboBox1.Items.Add(D1(0).ToString)
End While
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim Cmd2 As New SqlCommand("select subshort from subject_details order by
subshort", con)
Dim D2 As SqlDataReader = Cmd2.ExecuteReader()
While D2.Read
ComboBox3.Items.Add(D2(0).ToString)
End While
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
If ComboBox3.Text = "" Then
MsgBox("Please enter the Subject Name")
Exit Sub
End If

If con.State = ConnectionState.Open Then con.Close()


con.Open()
Dim cmd2 As New SqlCommand("Delete from attendance where course='" &
ComboBox1.Text & "' and sem='" & ComboBox2.Text & "' and sub='" & ComboBox3.Text &
"'", con)
cmd2.ExecuteNonQuery()

If con.State = ConnectionState.Open Then con.Close()


For Each r As DataGridViewRow In dg.Rows
If r.Cells(1).Value = "" Then Exit For
q1var = "insert into attendance("
q2Var = " values("
q1var = q1var & "date" & ","
q2Var = q2Var & "'" & Format(aDate.Value, "dd/MMM/yyyy") & "',"
q1var = q1var & "course" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1var = q1var & "sem" & ","
q2Var = q2Var & "'" & ComboBox2.Text & "',"
q1var = q1var & "sub" & ","

Department of BCA 58
COLLEGE MANAGEMENT SYSTEM

q2Var = q2Var & "'" & ComboBox3.Text & "',"


q1var = q1var & "regno" & ","
q2Var = q2Var & "" & r.Cells(0).Value & ","
q1var = q1var & "name" & ","
q2Var = q2Var & "'" & r.Cells(1).Value & "',"
q1var = q1var & "attendance" & ")"
q2Var = q2Var & "" & Val(r.Cells(2).Value) & ")"
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd1 As New SqlCommand(q1var & q2var, con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
Next
MsgBox("Records saved successfully")
End Sub

Private Sub dissavedbtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles dissavedbtn.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select regno,name,attendance From attendance where
course='" & ComboBox1.Text & "' and sem='" & ComboBox2.Text & "' and sub='" &
ComboBox3.Text & "' order by regno", con)
adp.Fill(DS1)
dg.DataSource = DS1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub attendancebtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles attendancebtn.Click
Dim DS1 As New DataSet
Dim Tab1 As DataTable = DS1.Tables.Add("AttnTab")
Tab1.Columns.Add("regno", GetType(Long))
Tab1.Columns.Add("stdname", GetType(String))

Tab1.Columns.Add("attendance", GetType(String))
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim Cmd0 As New SqlCommand("Select regno,stdname from student_details where
coursename='" & ComboBox1.Text & "' and semester='" & ComboBox2.Text & "' order by
regno", con)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
While D1.Read
Dim dRow As DataRow = Tab1.NewRow
dRow(0) = D1(0).ToString
dRow(1) = D1(1).ToString
dRow(2) = ""

Department of BCA 59
COLLEGE MANAGEMENT SYSTEM

Tab1.Rows.Add(dRow)
End While
If con.State = ConnectionState.Open Then con.Close()
dg.DataSource = DS1.Tables(0)
End Sub
End Class

10) EXAM MAEKS ENTRY

Imports System.Data.SqlClient

Public Class Exam_Marks_Entry


Dim q1var, q2var As String
Dim pkvar As String
Private Sub Exam_Marks_Entry_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim Cmd1 As New SqlCommand("select coursename from course order by coursename",
con)
Dim D1 As SqlDataReader = Cmd1.ExecuteReader()
While D1.Read
ComboBox1.Items.Add(D1(0).ToString)
End While
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim Cmd2 As New SqlCommand("select subshort from subject_details order by
subshort", con)
Dim D2 As SqlDataReader = Cmd2.ExecuteReader()
While D2.Read
ComboBox3.Items.Add(D2(0).ToString)
End While

If con.State = ConnectionState.Open Then con.Close()


End Sub

Private Sub displaybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles displaybtn.Click
Dim DS1 As New DataSet
Dim Tab1 As DataTable = DS1.Tables.Add("AttnTab")
Tab1.Columns.Add("RegNo", GetType(Long))
Tab1.Columns.Add("sName", GetType(String))
Tab1.Columns.Add("tMarks", GetType(String))
If con.State = ConnectionState.Open Then con.Close()
con.Open()

Department of BCA 60
COLLEGE MANAGEMENT SYSTEM

Dim Cmd0 As New SqlCommand("Select regno,stdname from student_details where


coursename='" & ComboBox1.Text & "' and semester='" & ComboBox2.Text & "' order by
regno", con)
Dim D1 As SqlDataReader = Cmd0.ExecuteReader()
While D1.Read
Dim dRow As DataRow = Tab1.NewRow
dRow(0) = D1(0).ToString
dRow(1) = D1(1).ToString
dRow(2) = ""
Tab1.Rows.Add(dRow)
End While
If con.State = ConnectionState.Open Then con.Close()
dg.DataSource = DS1.Tables(0)
End Sub

Private Sub savebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles savebtn.Click
If ComboBox1.Text = "" Then
MsgBox("Please select the course Name")
Exit Sub
End If
If ComboBox2.Text = "" Then
MsgBox("Please select the sem")
Exit Sub
End If
If ComboBox3.Text = "" Then
MsgBox("Please enter the Subject Name")
Exit Sub
End If
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim cmd2 As New SqlCommand("Delete from exam_marks_entry where course='" &
ComboBox1.Text & "' and sem='" & ComboBox2.Text & "' and sub='" & ComboBox3.Text &
"'", con)
cmd2.ExecuteNonQuery()

If con.State = ConnectionState.Open Then con.Close()


For Each r As DataGridViewRow In dg.Rows
If r.Cells(1).Value = "" Then Exit For
q1var = "insert into exam_marks_entry("
q2Var = " values("
q1var = q1var & "examdate" & ","
q2var = q2var & "'" & Format(aDate.Value, "dd/MMM/yyyy") & "',"
q1var = q1var & "course" & ","
q2Var = q2Var & "'" & ComboBox1.Text & "',"
q1var = q1var & "sem" & ","
q2Var = q2Var & "'" & ComboBox2.Text & "',"
q1var = q1var & "sub" & ","

Department of BCA 61
COLLEGE MANAGEMENT SYSTEM

q2Var = q2Var & "'" & ComboBox3.Text & "',"


q1var = q1var & "regno" & ","
q2Var = q2Var & "" & r.Cells(0).Value & ","
q1var = q1var & "name" & ","
q2var = q2var & "'" & r.Cells(1).Value & "',"
q1var = q1var & "marks1" & ")"
q2var = q2var & "" & Val(r.Cells(2).Value) & ")"
If con.State = ConnectionState.Open Then con.Close()
con.Open()
MsgBox(q1var & q2var)
Dim cmd1 As New SqlCommand(q1var & q2var, con)
cmd1.ExecuteNonQuery()
If con.State = ConnectionState.Open Then con.Close()
Next
MsgBox("Records saved successfully")
End Sub

Private Sub dissavedbtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles dissavedbtn.Click
If ComboBox3.Text = "" Then
MsgBox("Please enter the Subject Name")
Exit Sub
End If

If con.State = ConnectionState.Open Then con.Close()


con.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select
regno,name,marks1,marks2,marks3,marks4,marks5 From exam_marks_entry where course='"
& ComboBox1.Text & "' and sem='" & ComboBox2.Text & "' and sub='" & ComboBox3.Text
& "' order by regno", con)
adp.Fill(DS1)
dg.DataSource = DS1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub
End Class

11) STAFF LIST

Imports System.Data.SqlClient
Public Class Staff_List

Department of BCA 62
COLLEGE MANAGEMENT SYSTEM

Private Sub Staff_List_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub printbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles printbtn.Click
PP1.ShowDialog()
End Sub

Private Sub displaybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles displaybtn.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select
staffcode,staffname,staffphno,staffmail,staffqualification,staffdesignation From staff_details
order by staffcode,staffname,staffphno,staffmail,staffqualification,staffdesignation", con)
adp.Fill(DS1)
dg.DataSource = DS1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As


System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim XPos, YPos As Long
YPos = 50
Dim MyFont As New Font("Arial", 18)

XPos = 10
e.Graphics.DrawString("RNSFGC College Administration", MyFont, Brushes.Black,
XPos, YPos)
YPos += 50
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("Channasandra, Bangalore - 560098", MyFont, Brushes.Black,
XPos, YPos)
YPos += 100
XPos = 10
e.Graphics.DrawString("Staff List Report", MyFont, Brushes.Black, XPos, YPos)
YPos += 50
XPos = 10
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("staffcode", MyFont, Brushes.Black, XPos, YPos)

Department of BCA 63
COLLEGE MANAGEMENT SYSTEM

XPos = XPos + 120


e.Graphics.DrawString("staffname", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 120
e.Graphics.DrawString("staffphno", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 120
e.Graphics.DrawString("staffmail", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 120
e.Graphics.DrawString("staffqualification", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("staffdesignation", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 120
YPos += 25
For Each r As DataGridViewRow In dg.Rows
XPos = 10
e.Graphics.DrawString(r.Cells(0).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 125
e.Graphics.DrawString(r.Cells(1).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 125
e.Graphics.DrawString(r.Cells(2).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 125
e.Graphics.DrawString(r.Cells(3).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 125
e.Graphics.DrawString(r.Cells(4).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 157
e.Graphics.DrawString(r.Cells(5).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 128
YPos += 25
Next
End Sub
End Class

12) STUDENTS LIST

Imports System.Data.SqlClient
Public Class Student_List

Private Sub Student_List_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
End Sub

Private Sub displaybtn_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles displaybtn.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()

Department of BCA 64
COLLEGE MANAGEMENT SYSTEM

Dim DS1 As New DataSet


Dim adp As New SqlDataAdapter("Select stdcourse,stdsem,stdregno From
student_details order by stdcourse,stdsem,stdregno", con)
adp.Fill(DS1)
dg.DataSource = DS1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub closebtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles closebtn.Click
Me.Close()
End Sub

Private Sub printbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles printbtn.Click
PP1.ShowDialog()
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As


System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim XPos, YPos As Long
YPos = 50

Dim MyFont As New Font("Arial", 18)


XPos = 10
e.Graphics.DrawString("RNSFGC College Administration", MyFont, Brushes.Black,
XPos, YPos)
YPos += 50
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("Channasandra, Bangalore - 560098", MyFont, Brushes.Black,
XPos, YPos)
YPos += 100
XPos = 10
e.Graphics.DrawString("Student List Report", MyFont, Brushes.Black, XPos, YPos)
YPos += 50
XPos = 10
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("stdregno", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("stdname", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("stdparentn", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("stdcourse", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("stdsem", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
YPos += 25

Department of BCA 65
COLLEGE MANAGEMENT SYSTEM

For Each r As DataGridViewRow In dg.Rows


XPos = 10
e.Graphics.DrawString(r.Cells(0).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(1).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(2).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(3).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(4).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
YPos += 25
Next
End Sub
End Class

13) FEES COLLECTION REPORT

Imports System.Data.SqlClient
Public Class Fee_Collection_Report

Private Sub Fee_Collection_Report_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button3.Click
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("Select
coursename,regno,stdname,totalfees,totalpaid,balamt From fees_collection order by
coursename,regno,stdname,totalfees,totalpaid,balamt", con)
adp.Fill(DS1)
dg.DataSource = DS1.Tables(0)
If con.State = ConnectionState.Open Then con.Close()
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
PP1.ShowDialog()

Department of BCA 66
COLLEGE MANAGEMENT SYSTEM

End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As


System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim XPos, YPos As Long
YPos = 50
Dim MyFont As New Font("Arial", 18)
XPos = 10
e.Graphics.DrawString("RNSFGC College Administration", MyFont, Brushes.Black,
XPos, YPos)
YPos += 50
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("Channasandra, Bangalore - 560098", MyFont, Brushes.Black,
XPos, YPos)
YPos += 100

XPos = 10
e.Graphics.DrawString("Student List Report", MyFont, Brushes.Black, XPos, YPos)
YPos += 50
XPos = 10
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("coursename", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("regno", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("stdname", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("totalfees", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("totalpaid", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString("balamt", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
YPos += 25
For Each r As DataGridViewRow In dg.Rows
XPos = 10
e.Graphics.DrawString(r.Cells(0).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(1).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(2).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(3).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(4).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(5).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150

Department of BCA 67
COLLEGE MANAGEMENT SYSTEM

YPos += 25
Next
End Sub
End Class

14) EXAM RESULT ALL

Imports System.Data.SqlClient
Public Class Exam_Result_All

Private Sub Exam_Result_All_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()
Dim DS1 As New DataSet
Dim adp As New SqlDataAdapter("select * from exam_marks_entry order by course",
con)
adp.Fill(DS1)
dg.DataSource = DS1.Tables(0)

If con.State = ConnectionState.Open Then con.Close()


End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
PP1.ShowDialog()
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As


System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim XPos, YPos As Long
YPos = 50
Dim MyFont As New Font("Arial", 18)
XPos = 10
e.Graphics.DrawString("RNSFGC College Administration", MyFont, Brushes.Black,
XPos, YPos)
YPos += 50
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("Channasandra, Bangalore - 560098", MyFont, Brushes.Black,
XPos, YPos)
YPos += 100
XPos = 10

Department of BCA 68
COLLEGE MANAGEMENT SYSTEM

e.Graphics.DrawString("Exam List Report", MyFont, Brushes.Black, XPos, YPos)


YPos += 50

XPos = 10
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("sub", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
e.Graphics.DrawString("regno", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
e.Graphics.DrawString("name", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
e.Graphics.DrawString("tmarks", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
YPos += 25
For Each r As DataGridViewRow In dg.Rows
XPos = 10
e.Graphics.DrawString(r.Cells(3).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
e.Graphics.DrawString(r.Cells(4).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
e.Graphics.DrawString(r.Cells(5).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
e.Graphics.DrawString(r.Cells(6).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 75
YPos += 25
Next
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button3.Click
Me.Close()
End Sub
End Class

15) EXAM RESULT

Imports System.Data.SqlClient
Public Class Exam_Result

Private Sub Exam_Result_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Me.WindowState = FormWindowState.Maximized
dg.RowCount = 25
dg.ColumnCount = 3
dg.Columns(0).Width = 150

dg.Columns(1).Width = 150

Department of BCA 69
COLLEGE MANAGEMENT SYSTEM

dg.Columns(0).HeaderText = ""
dg.Columns(1).HeaderText = ""
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button3.Click
Me.Close()
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button2.Click
If con.State = ConnectionState.Open Then con.Close()
con.Open()
i=1
dg.Rows.Clear()
dg.RowCount = 20
dg.Rows(i).Cells(0).Value = "regno"
dg.Rows(i).Cells(1).Value = TextBox1.Text
i=i+1
Dim cmd2a As New SqlCommand("select * from student_details where regno='" &
Val(TextBox1.Text) & "'", con)
Dim d2a As SqlDataReader = cmd2a.ExecuteReader()
If d2a.Read Then
dg.Rows(i).Cells(0).Value = "stdname"
dg.Rows(i).Cells(1).Value = d2a.GetValue(1).ToString
i=i+1
dg.Rows(i).Cells(0).Value = "coursename"
dg.Rows(i).Cells(1).Value = d2a.GetValue(4).ToString
i=i+1
dg.Rows(i).Cells(0).Value = "semester"
dg.Rows(i).Cells(1).Value = d2a.GetValue(5).ToString
i=i+1
End If
If con.State = ConnectionState.Open Then con.Close()
con.Open()

Dim cmd0 As New SqlCommand("select attendance from attendance where regno='" &
Val(TextBox1.Text) & "'", con)
Dim d1 As SqlDataReader = cmd0.ExecuteReader()
If d1.Read Then
dg.Rows(i).Cells(0).Value = "attendance"
dg.Rows(i).Cells(1).Value = d1.GetValue(0).ToString
i=i+1
End If
con.Close()
If con.State = ConnectionState.Open Then con.Close()
con.Open()

Department of BCA 70
COLLEGE MANAGEMENT SYSTEM

Dim cmd4 As New SqlCommand("select * from exam_marks_entry where regno='"


&Val(TextBox1.Text) & "'", con)
Dim d4 As SqlDataReader = cmd4.ExecuteReader()
Do While d4.Read
dg.Rows(i).Cells(0).Value = d4.GetValue(3).ToString
dg.Rows(i).Cells(1).Value = d4.GetValue(6).ToString
i=i+1
Loop
con.Close()
End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Char.IsDigit(e.KeyChar) = False And Char.IsControl(e.KeyChar) = False Then
e.Handled = True
MsgBox("Please enter a valid number")
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


Handles Button1.Click
PP1.ShowDialog()
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As


System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
Dim XPos, YPos As Long
YPos = 50
Dim MyFont As New Font("Arial", 18)
XPos = 10
e.Graphics.DrawString("RNSFGC College Administration", MyFont, Brushes.Black,
XPos, YPos)
YPos += 50

MyFont = New Font("Arial", 12)


e.Graphics.DrawString("Channasandra, Bangalore - 560098", MyFont, Brushes.Black,
XPos, YPos)
YPos += 100
XPos = 10
e.Graphics.DrawString("Exam Result List Report", MyFont, Brushes.Black, XPos, YPos)
YPos += 50
XPos = 10
MyFont = New Font("Arial", 12)
e.Graphics.DrawString("Column Name ", MyFont, Brushes.Black, XPos, YPos)

XPos = XPos + 150


e.Graphics.DrawString("Result", MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150

Department of BCA 71
COLLEGE MANAGEMENT SYSTEM

YPos += 25
For Each r As DataGridViewRow In dg.Rows
XPos = 10
e.Graphics.DrawString(r.Cells(0).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
e.Graphics.DrawString(r.Cells(1).Value, MyFont, Brushes.Black, XPos, YPos)
XPos = XPos + 150
YPos += 25
Next
End Sub
End Class

Department of BCA 72
COLLEGE MANAGEMENT SYSTEM

CHAPTER 15
Conclusion
The Attendance Management System is developed using Visual Basic.NET fully meets the
objectives of the system which it has been developed. The system has reached a steady state
where all bugs have been eliminated. The system is operated at a high level of efficiency and
all the teachers and user associated with the system understands its advantage. The system
solves the problem. It was intended to solve as requirement specification.

Department of BCA 73
COLLEGE MANAGEMENT SYSTEM

BIBLIOGRAPHY

1. The complete Reference Visual Basic.NET


2. Beginning VB.NET (Wrox Publication)
3. System Analysis and Design – Alias M. Awad
4. Software Engineering – Roger Pressman
5. www.microsoft.com
6. www.w3schools.com
7. www.dotnetspider.com

Department of BCA 74

You might also like