This document appears to be a project report for a Phone Book application developed in Visual Basic .NET. The report includes chapters covering an introduction to the project, requirements specification, system design, implementation details through code snippets, testing plans, and conclusions. The Phone Book application allows users to store, search, update, and delete contact information from a central database for easy access from anywhere. Administrative users can manage the data while regular users can only view contacts. The system aims to simplify contact management and storage compared to traditional paper phone books.
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Phone Book Project Report
1. P a g e | 1
A PROJECT REPORT
Under the guidance Of
...............................................
(Associate Professor)
(................................................. Jaipur)
_________________________
Submitted by
SHANKAR PRASAD GURJAR
_________________________
in partial fulfilment of the requirement for the award of the degree
of
Bachelor of Computer Applications
Department of Information Technology
July 2017
Shankar_G
urjar
2. P a g e | 2
Figure 1: - Bonafide Certificate
Shankar_G
urjar
3. P a g e | 3
Abstract:
Phone Book System is a small web application developed for mini project
students. In olden days we stored all our important contact details in books and
papers. Here we proposed a new system, by using this application we can store
all the details in a central repository.
In manual method if we forget information book then it is very difficult to get
the contact details. By using this application, we can see our contacts anywhere
in the world, here we will have security to the login page and no one can see our
contacts without proper authentication. In this project we can save our contacts
and we can search them by name and we can see all of them at a time.
Shankar_G
urjar
4. P a g e | 4
TABLE OF CONTENTS
CHAPTER NO. TITLE PAGE
Abstract 3
Project Review Report 5
Chapter 1 Introduction 6
General introduction 6
Literature survey 7
Proposed System 8
Objective 8
Problem Statement 10
Chapter 2 Requirement specification 12
Chapter 3 System design 13
Chapter 4 Implementation
Chapter 5 System testing 37
Chapter 6 Results (Input and Output Screenshots) 41
Chapter 7 Limitations and Future of project 49
Conclusion 50
References/Bibliography 51
Shankar_G
urjar
5. P a g e | 5
Project Review Report
Figure 2: - Project Review Report
Shankar_G
urjar
6. P a g e | 6
Chapter 1: Introduction
GENERAL INTRODUCTION
Phone Book is a project that is provide by technical assignment help to
us in that we get a simple SQL based solution to store our contacts. We
can use it to replace our hard phonebook or even use it as an office-
wide phone directory. This will help user to easily search and manage
contacts using this system.
This system is developed using the general need required by the user
while using the phone directory book. In order to keep updated the
phone book directory, the admin will have the authority to add and
delete as well as modify the existing records within the phone book
directory. The users of the directory will only have the authority to
search any particular record and listing details of all available records.
To provide the search result within short interval of time optimized
search algorithm code have been used that will able to provide the
results within seconds.
Shankar_G
urjar
7. P a g e | 7
Literature Survey: -
Phone Book is a project that is provide by technical assignment
help to us in that we get a simple SQL based solution to store
our contacts.
This will help user to easily search and manage contacts using
this system.
The names are present in user-sated formats like alphabetical
order, according to time, date, recently etc. so that user also can
easily find the required person along with their address and
telephone numbers and use search option.
For searching operation, users will able to get any particular
record using their contact or phone number but the only
condition is that, customers record must be available within the
file system.
Shankar_G
urjar
8. P a g e | 8
Proposed System
Under this Phonebook Project, all the functionality has been added to
meet the user’s requirements in just few seconds. To provide the
desired result on time, it is using with SQL server, Active-X in any
Windows system and used binary search method has been used to
produce results on minimal time. As customers do not have to
purchase new volumes, each year and even they do not have to wait
for the New Year to get updated records. As the new customer does
the user side, so users will able to get updated information each time
will update details. To eliminate data redundancy and perform
validation process background codes by the class will responsible to
do this task. If user will make any mistake while entering, they will be
given a warning along with correction, which is required to be made.
It will also guide the customers to use this system in convenient
manner through its graphical screen. It not only contains local codes
but also ISD codes. The names are present in user-sated formats like
alphabetical order, according to time, date, recently etc. so that user
also can easily find the required person along with their address and
telephone numbers and use search option.
Objective
This system is developed using the general need required by the user
while using the phone directory book and provided a lot of facility to
their user. The objective of my Project Phone Book is to record the
details various activities of user. It will simplify the task and reduce
the paper work. The system is very user friendly and it is anticipated
that administrators, academics, students and applicants will easily
access functions of the system.
Most Objectives of this Project are following: -
Fast Speed Data Processing.
To record the details various activities of user.
Shankar_G
urjar
9. P a g e | 9
It will simplify the task and reduce the paper work.
The system is very user friendly.
Easily accessed by administrators, academics, students and
applicants.
Shankar_G
urjar
10. P a g e | 10
Problem Statement: -
Phone Book is a project that is provide by technical assignment help
to us in that we get a simple SQL based solution to store our contacts.
We can use it to replace our hard phonebook or even use it as an
office-wide phone directory. This will help user to easily search and
manage contacts using this system. Phonebook is the one, which
contain details of an individual along with their landline numbers.
Apart from the telephone number of individuals, it also contains
address and number of important relatives of individual. It not only
contains local codes but also ISD codes. The names are present in
user-sated formats like alphabetical order, according to time, date,
recently etc. so that user also can easily find the required person along
with their address and telephone numbers and use search option. This
system is developed using the general need required by the user while
using the phone directory book. In order to keep updated the phone
book directory, the admin will have the authority to add and delete as
well as modify the existing records within the phone book directory.
The users of the directory will only have the authority to search any
particular record and listing details of all available records. Admin
will have the authority to perform various operations such as add
customer records, search any particular record, delete record, modify
existing record etc. To provide the search result within short interval
of time optimized search algorithm code have been used that will able
to provide the results within seconds. To make all operations as easier
as possible, user-friendly approach has been taken into account by
which users have to only give their answer during final confirmation
to make their operations successful. The background processing
system will take care of all processing task and maintain data integrity
in order to reduce the redundancy of data. For searching operation,
users will able to get any particular record using their contact or
Shankar_G
urjar
11. P a g e | 11
phone number but the only condition is that, customers record must
be available within the file system. If no such record will be available,
proper error message will be displayed as per user input provided to
the system.
Shankar_G
urjar
12. P a g e | 12
Chapter 2: Requirement Specification
Project Technical Specification: –
Visual Editor Visual Studio 2012 Ultimate Edition
Programing Language Visual Basic .NET
Database Support MicrosoftSQL2008
Frame work version Microsoft .NET Frame work 4.0
Windows installer Windows installer 3.1
Project Type Contact data management
Hardware and Software Requirement
Hardware: -
Hard Disk 250 MB of free space
RAM 512 MB
Screen Resolution 1024x768
Processor Intel P4 or Latest
Software: -
Database Support Microsoft SQL 2008
Framework version Microsoft .NET Framework
4.0
Windows installer Windows installer 3.1
Internet Connection: -
YES
Shankar_G
urjar
13. P a g e | 13
Chapter 3: System Design
IF YES IF NO
START
WELCOME TO THE MAIN
MENU
ENTER YOUR
CHOICE
NEW ENTRY
DISPLAY AN
ENTRY
DELETE AN
ENTRY
DISPLAY ALL
ENTRIES
EMPTY THE
BOOK
SAVE ENTRY
LOAD
ENTRIES
DELETE ALL
FILES
END
STOP
IF U WANT TO
CONTINUE
Figure 3: - System Design
Shankar_G
urjar
14. P a g e | 14
Figure 4:- Database Diagram
Database
Users
New Create,
Edit, Search,
Print,
Database Diagram: -
Shankar_G
urjar
15. P a g e | 15
Chapter 4: Implementation
Code for Phone Book main page: -
Imports System.Data
Imports System.Data.SqlClient
Public Class FRM_MainPage
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As SqlDataReader
Dim foundFlag As Integer = 0
Sub createConnection()
myConnection = New SqlConnection("Data
Source=.SQLEXPRESS;AttachDbFilename=" & Application.StartupPath &
"PhoneBook.mdf;Integrated Security=True;Connect Timeout=30;User
Instance=True")
End Sub
Sub fillComboBoxAndListBox()
Try
createConnection()
myConnection.Open()
Shankar_G
urjar
16. P a g e | 16
myCommand = New SqlCommand("Select * from Contacts",
myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
CBO_Contacts.Items.Add(dr(0).ToString())
LBOX_Contacts.Items.Add(dr(0).ToString())
End While
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Private Sub FRM_MainPage_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
fillComboBoxAndListBox()
End Sub
Sub showContactsInfo()
While dr.Read()
TXT_FName.Text = dr(0).ToString()
TXT_LName.Text = dr(1).ToString()
TXT_CellNumber1.Text = dr(2).ToString()
Shankar_G
urjar
17. P a g e | 17
TXT_CellNumber2.Text = dr(3).ToString()
TXT_ResidenceNumber1.Text = dr(4).ToString()
TXT_ResidenceNumber2.Text = dr(5).ToString()
TXT_OfficeNumber.Text = dr(6).ToString()
TXT_OfficeAddress.Text = dr(7).ToString()
TXT_EmergencyNumber.Text = dr(8).ToString()
TXT_EmailAddress.Text = dr(9).ToString()
TXT_HomeAddress.Text = dr(10).ToString()
TXT_BirthDate.Text = dr(11).ToString()
TXT_Group.Text = dr(12).ToString()
End While
End Sub
Sub showContactsInComboBox()
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts Where
firstName ='" & CBO_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
showContactsInfo()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
Shankar_G
urjar
18. P a g e | 18
myConnection.Close()
End Try
End Sub
Sub showContactsInListBox()
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts Where
firstName ='" & LBOX_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
showContactsInfo()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Dim selectedStr As String = Nothing
Private Sub CBO_Contacts_SelectedValueChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles CBO_Contacts.SelectedValueChanged
showContactsInComboBox()
Shankar_G
urjar
19. P a g e | 19
End Sub
Private Sub LBOX_Contacts_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
LBOX_Contacts.SelectedIndexChanged
showContactsInListBox()
selectedStr = LBOX_Contacts.SelectedItem
End Sub
Private Sub BTN_Exit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Exit.Click
End
End Sub
Sub clearAll()
TXT_FName.Clear()
TXT_LName.Clear()
TXT_CellNumber1.Clear()
TXT_CellNumber2.Clear()
TXT_ResidenceNumber1.Clear()
TXT_ResidenceNumber2.Clear()
TXT_OfficeNumber.Clear()
TXT_OfficeAddress.Clear()
TXT_EmergencyNumber.Clear()
TXT_EmailAddress.Clear()
Shankar_G
urjar
20. P a g e | 20
TXT_HomeAddress.Clear()
TXT_BirthDate.Clear()
TXT_Group.Clear()
End Sub
Private Sub BTN_Delete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Delete.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Delete from Contacts Where
firstName ='" & LBOX_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("Successfully Deleted", MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
clearAll()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
Shankar_G
urjar
21. P a g e | 21
End Try
End Sub
Private Sub BTN_Add_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Add.Click
clearAll()
End Sub
Sub checkIfExistsOrNot()
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts ",
myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
If TXT_FName.Text = dr(0).ToString() Then
foundFlag = 1
End If
End While
End Sub
Private Sub BTN_Save_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Save.Click
checkIfExistsOrNot()
If TXT_FName.Text <> "" Then
Shankar_G
urjar
22. P a g e | 22
If foundFlag = 0 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("INSERT INTO
[Contacts](firstName,lastName,cellNumber1,cellNumber2,residentialNumber1,
residentialNumber2,officeNumber,officeAddress,emergencyNumber,emailAddr
ess,homeAddress,birthDate,groupName) VALUES ('" & TXT_FName.Text &
"','" & TXT_LName.Text & "','" & TXT_CellNumber1.Text & "','" &
TXT_CellNumber2.Text & "','" & TXT_ResidenceNumber1.Text & "','" &
TXT_ResidenceNumber2.Text & "','" & TXT_OfficeNumber.Text & "','" &
TXT_OfficeAddress.Text & "','" & TXT_EmergencyNumber.Text & "','" &
TXT_EmailAddress.Text & "','" & TXT_HomeAddress.Text & "','" &
TXT_BirthDate.Text & "','" & TXT_Group.Text & "')", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY ADDED",
MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Shankar_G
urjar
23. P a g e | 23
Else
MsgBox("CONTACT ALREADY EXISTS, CANNOT BE ADDED",
MsgBoxStyle.Information)
End If
Else
MsgBox("ENTER FIRST NAME FIRST", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Private Sub BTN_Update_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles BTN_Update.Click
checkIfExistsOrNot()
If foundFlag = 1 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET
lastName ='" & TXT_LName.Text & "', cellNumber1 ='" &
TXT_CellNumber1.Text & "', cellNumber2 ='" & TXT_CellNumber2.Text &
"', residentialNumber1 ='" & TXT_ResidenceNumber1.Text & "',
residentialNumber2 ='" & TXT_ResidenceNumber2.Text & "', officeNumber
='" & TXT_OfficeNumber.Text & "', officeAddress ='" &
TXT_OfficeAddress.Text & "', emergencyNumber ='" &
TXT_EmergencyNumber.Text & "', emailAddress ='" &
TXT_EmailAddress.Text & "', homeAddress ='" & TXT_HomeAddress.Text &
"', birthDate ='" & TXT_BirthDate.Text & "', groupName ='" &
TXT_Group.Text & "' where firstName = '" & TXT_FName.Text & "'",
myConnection)
Shankar_G
urjar
24. P a g e | 24
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY UPDATED",
MsgBoxStyle.Information)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Else
MsgBox("YOU CANNOT UPDATE A CONTACT WHICH IS NOT
IN THE DATABASE, FIRST SAVE THAT CONTACT THEN YOU CAN
UPDATE", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Private Sub BTN_Rename_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles BTN_Rename.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET firstName
='" & TXT_FName.Text & "' where firstName = '" & selectedStr & "'",
myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY RENAMED", MsgBoxStyle.Information)
Shankar_G
urjar
25. P a g e | 25
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Private Sub GBOX_ContactsDetail_Enter(sender As Object, e As EventArgs)
Handles GBOX_ContactsDetail.Enter
End Sub
End Class
Shankar_G
urjar
26. P a g e | 26
Coding for ADD NEW
Sub clearAll()
TXT_FName.Clear()
TXT_LName.Clear()
TXT_CellNumber1.Clear()
TXT_CellNumber2.Clear()
TXT_ResidenceNumber1.Clear()
TXT_ResidenceNumber2.Clear()
TXT_OfficeNumber.Clear()
TXT_OfficeAddress.Clear()
TXT_EmergencyNumber.Clear()
TXT_EmailAddress.Clear()
TXT_HomeAddress.Clear()
TXT_BirthDate.Clear()
TXT_Group.Clear()
End Sub
Private Sub BTN_Delete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Delete.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Delete from Contacts Where
firstName ='" & LBOX_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("Successfully Deleted", MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
clearAll()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Private Sub BTN_Add_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Add.Click
Shankar_G
urjar
27. P a g e | 27
clearAll()
End Sub
Shankar_G
urjar
28. P a g e | 28
Code for “SAVE”
Sub checkIfExistsOrNot()
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts ",
myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
If TXT_FName.Text = dr(0).ToString() Then
foundFlag = 1
End If
End While
End Sub
Private Sub BTN_Save_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Save.Click
checkIfExistsOrNot()
If TXT_FName.Text <> "" Then
If foundFlag = 0 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("INSERT INTO
[Contacts](firstName,lastName,cellNumber1,cellNumber2,residentialNumber1,
residentialNumber2,officeNumber,officeAddress,emergencyNumber,emailAddr
ess,homeAddress,birthDate,groupName) VALUES ('" & TXT_FName.Text &
"','" & TXT_LName.Text & "','" & TXT_CellNumber1.Text & "','" &
TXT_CellNumber2.Text & "','" & TXT_ResidenceNumber1.Text & "','" &
TXT_ResidenceNumber2.Text & "','" & TXT_OfficeNumber.Text & "','" &
TXT_OfficeAddress.Text & "','" & TXT_EmergencyNumber.Text & "','" &
TXT_EmailAddress.Text & "','" & TXT_HomeAddress.Text & "','" &
TXT_BirthDate.Text & "','" & TXT_Group.Text & "')", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY ADDED",
MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
Shankar_G
urjar
29. P a g e | 29
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Else
MsgBox("CONTACT ALREADY EXISTS, CANNOT BE ADDED",
MsgBoxStyle.Information)
End If
Else
MsgBox("ENTER FIRST NAME FIRST", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Private Sub BTN_Update_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles BTN_Update.Click
checkIfExistsOrNot()
If foundFlag = 1 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET
lastName ='" & TXT_LName.Text & "', cellNumber1 ='" &
TXT_CellNumber1.Text & "', cellNumber2 ='" & TXT_CellNumber2.Text &
"', residentialNumber1 ='" & TXT_ResidenceNumber1.Text & "',
residentialNumber2 ='" & TXT_ResidenceNumber2.Text & "', officeNumber
='" & TXT_OfficeNumber.Text & "', officeAddress ='" &
TXT_OfficeAddress.Text & "', emergencyNumber ='" &
TXT_EmergencyNumber.Text & "', emailAddress ='" &
TXT_EmailAddress.Text & "', homeAddress ='" & TXT_HomeAddress.Text &
"', birthDate ='" & TXT_BirthDate.Text & "', groupName ='" &
TXT_Group.Text & "' where firstName = '" & TXT_FName.Text & "'",
myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY UPDATED",
MsgBoxStyle.Information)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Shankar_G
urjar
30. P a g e | 30
Else
MsgBox("YOU CANNOT UPDATE A CONTACT WHICH IS NOT
IN THE DATABASE, FIRST SAVE THAT CONTACT THEN YOU CAN
UPDATE", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Shankar_G
urjar
31. P a g e | 31
Code for “UPDATE”
Sub checkIfExistsOrNot()
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts ",
myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
If TXT_FName.Text = dr(0).ToString() Then
foundFlag = 1
End If
End While
End Sub
Private Sub BTN_Save_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Save.Click
checkIfExistsOrNot()
If TXT_FName.Text <> "" Then
If foundFlag = 0 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("INSERT INTO
[Contacts](firstName,lastName,cellNumber1,cellNumber2,residentialNumber1,
residentialNumber2,officeNumber,officeAddress,emergencyNumber,emailAddr
ess,homeAddress,birthDate,groupName) VALUES ('" & TXT_FName.Text &
"','" & TXT_LName.Text & "','" & TXT_CellNumber1.Text & "','" &
TXT_CellNumber2.Text & "','" & TXT_ResidenceNumber1.Text & "','" &
TXT_ResidenceNumber2.Text & "','" & TXT_OfficeNumber.Text & "','" &
TXT_OfficeAddress.Text & "','" & TXT_EmergencyNumber.Text & "','" &
TXT_EmailAddress.Text & "','" & TXT_HomeAddress.Text & "','" &
TXT_BirthDate.Text & "','" & TXT_Group.Text & "')", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY ADDED",
MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Shankar_G
urjar
32. P a g e | 32
Finally
dr.Close()
myConnection.Close()
End Try
Else
MsgBox("CONTACT ALREADY EXISTS, CANNOT BE ADDED",
MsgBoxStyle.Information)
End If
Else
MsgBox("ENTER FIRST NAME FIRST", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Private Sub BTN_Update_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles BTN_Update.Click
checkIfExistsOrNot()
If foundFlag = 1 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET
lastName ='" & TXT_LName.Text & "', cellNumber1 ='" &
TXT_CellNumber1.Text & "', cellNumber2 ='" & TXT_CellNumber2.Text &
"', residentialNumber1 ='" & TXT_ResidenceNumber1.Text & "',
residentialNumber2 ='" & TXT_ResidenceNumber2.Text & "', officeNumber
='" & TXT_OfficeNumber.Text & "', officeAddress ='" &
TXT_OfficeAddress.Text & "', emergencyNumber ='" &
TXT_EmergencyNumber.Text & "', emailAddress ='" &
TXT_EmailAddress.Text & "', homeAddress ='" & TXT_HomeAddress.Text &
"', birthDate ='" & TXT_BirthDate.Text & "', groupName ='" &
TXT_Group.Text & "' where firstName = '" & TXT_FName.Text & "'",
myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY UPDATED",
MsgBoxStyle.Information)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Else
Shankar_G
urjar
33. P a g e | 33
MsgBox("YOU CANNOT UPDATE A CONTACT WHICH IS NOT
IN THE DATABASE, FIRST SAVE THAT CONTACT THEN YOU CAN
UPDATE", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Shankar_G
urjar
34. P a g e | 34
Code for “DELETE”
Private Sub BTN_Delete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Delete.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Delete from Contacts Where
firstName ='" & LBOX_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("Successfully Deleted", MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
clearAll()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Shankar_G
urjar
35. P a g e | 35
Code for “RENAME”
Private Sub BTN_Rename_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Rename.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET firstName
='" & TXT_FName.Text & "' where firstName = '" & selectedStr & "'",
myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY RENAMED", MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Shankar_G
urjar
36. P a g e | 36
Code for “EXIT”
Private Sub BTN_Exit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Exit.Click
End
End Sub
Code for “SEARCH”
Private Sub LBL_SearchContacts_Click(sender As Object, e As EventArgs)
Handles LBL_SearchContacts.Click
End Sub
End Class
Shankar_G
urjar
37. P a g e | 37
Chapter 5: SYSTEM TESTING
The purpose of testing is to discover errors. Testing is the process of
trying to discover every conceivable fault or weakness in a work
product. It provides a way to check the functionality of components,
sub-assemblies, assemblies and/or a finished product It is the process
of exercising software with the intent of ensuring that the
Software system meets its requirements and user expectations and does
not fail in an unacceptable manner. There are various types of test. Each
test type addresses a specific testing requirement.
TYPES OF TESTS:
Unit testing
Unit testing involves the design of test cases that validate that the
internal program logic is functioning properly, and that program inputs
produce valid outputs. All decision branches and internal code flow
should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before
integration. This is a structural testing, that relies on knowledge of its
construction and is invasive. Unit tests perform basic tests at
component level and test a specific business process, application,
Shankar_G
urjar
38. P a g e | 38
and/or system configuration. Unit tests ensure that each unique path of
a business process performs accurately to the documented
specifications and contains clearly defined inputs and expected results.
Integration testing:
Integration tests are designed to test integrated software components
to determine if they actually run as one program. Testing is event
driven and is more concerned with the basic outcome of screens or
fields. Integration tests demonstrate that although the components were
individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration
testing is specifically aimed at exposing the problems that arise from
the combination of components.
Functional test:
Functional tests provide systematic demonstrations that functions
tested are available as specified by the business and technical
requirements, system documentation, and user manuals.
Functional testing is cantered on the following items:
Valid Input : identified classes of valid input must be
accepted.
Invalid : identified classes of invalid input must be
rejected.
Functions : identified functions must be exercised.
Shankar_G
urjar
39. P a g e | 39
Output : identified classes of application outputs must be
exercised.
Systems/Procedures: interfacing systems or procedures must be
invoked.
Organization and preparation of functional tests is focused on
requirements, key functions, or special test cases. In addition,
systematic coverage pertaining to identify Business process flows; data
fields, predefined processes, and successive processes must be
considered for testing. Before functional testing is complete, additional
tests are identified and the effective value of current tests is determined.
System Test:
System testing ensures that the entire integrated software system
meets requirements. It tests a configuration to ensure known and
predictable results. An example of system testing is the configuration
oriented system integration test. System testing is based on process
descriptions and flows, emphasizing pre-driven process links and
integration points.
White Box Testing:
White Box Testing is a testing in which in which the software
tester has knowledge of the inner workings, structure and language of
the software, or at least its purpose. It is purpose. It is used to test areas
that cannot be reached from a black box level.
Shankar_G
urjar
40. P a g e | 40
Black Box Testing:
Black Box Testing is testing the software without any knowledge
of the inner workings, structure or language of the module being tested.
Black box tests, as most other kinds of tests, must be written from a
definitive source document, such as specification or requirements
document, such as specification or requirements document. It is a
testing in which the software under test is treated, as a black box. you
cannot “see” into it. The test provides inputs and responds to outputs
without considering how the software works.
Acceptance Testing:
User Acceptance Testing is a critical phase of any project and requires
significant participation by the end user. It also ensures that the system
meets the functional requirements.
Test Results: All the test cases mentioned above passed successfully.
No defects encountered.
Shankar_G
urjar
41. P a g e | 41
Chapter 6: Results (Input and Output Screen snapshots)
OUT PUT
Figure 5: - Home screen
INPUT
Imports System.Data
Imports System.Data.SqlClient
Public Class FRM_MainPage
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As SqlDataReader
Dim foundFlag As Integer = 0
Sub createConnection()
Shankar_G
urjar
42. P a g e | 42
myConnection = New SqlConnection("Data
Source=.SQLEXPRESS;AttachDbFilename=" & Application.StartupPath &
"PhoneBook.mdf;Integrated Security=True;Connect Timeout=30;User
Instance=True")
End Sub
Sub fillComboBoxAndListBox()
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts",
myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
CBO_Contacts.Items.Add(dr(0).ToString())
LBOX_Contacts.Items.Add(dr(0).ToString())
End While
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Private Sub FRM_MainPage_Load(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles MyBase.Load
fillComboBoxAndListBox()
End Sub
Sub showContactsInfo()
While dr.Read()
TXT_FName.Text = dr(0).ToString()
TXT_LName.Text = dr(1).ToString()
TXT_CellNumber1.Text = dr(2).ToString()
TXT_CellNumber2.Text = dr(3).ToString()
TXT_ResidenceNumber1.Text = dr(4).ToString()
TXT_ResidenceNumber2.Text = dr(5).ToString()
TXT_OfficeNumber.Text = dr(6).ToString()
TXT_OfficeAddress.Text = dr(7).ToString()
TXT_EmergencyNumber.Text = dr(8).ToString()
TXT_EmailAddress.Text = dr(9).ToString()
TXT_HomeAddress.Text = dr(10).ToString()
Shankar_G
urjar
43. P a g e | 43
TXT_BirthDate.Text = dr(11).ToString()
TXT_Group.Text = dr(12).ToString()
End While
End Sub
Sub showContactsInComboBox()
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts Where
firstName ='" & CBO_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
showContactsInfo()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Sub showContactsInListBox()
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts Where
firstName ='" & LBOX_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
showContactsInfo()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Dim selectedStr As String = Nothing
Private Sub CBO_Contacts_SelectedValueChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles CBO_Contacts.SelectedValueChanged
showContactsInComboBox()
End Sub
Shankar_G
urjar
44. P a g e | 44
Private Sub LBOX_Contacts_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
LBOX_Contacts.SelectedIndexChanged
showContactsInListBox()
selectedStr = LBOX_Contacts.SelectedItem
End Sub
Private Sub BTN_Exit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Exit.Click
End
End Sub
Sub clearAll()
TXT_FName.Clear()
TXT_LName.Clear()
TXT_CellNumber1.Clear()
TXT_CellNumber2.Clear()
TXT_ResidenceNumber1.Clear()
TXT_ResidenceNumber2.Clear()
TXT_OfficeNumber.Clear()
TXT_OfficeAddress.Clear()
TXT_EmergencyNumber.Clear()
TXT_EmailAddress.Clear()
TXT_HomeAddress.Clear()
TXT_BirthDate.Clear()
TXT_Group.Clear()
End Sub
Private Sub BTN_Delete_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Delete.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Delete from Contacts Where
firstName ='" & LBOX_Contacts.Text & "'", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("Successfully Deleted", MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
clearAll()
showContactsInfo()
Shankar_G
urjar
45. P a g e | 45
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Private Sub BTN_Add_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Add.Click
clearAll()
End Sub
Sub checkIfExistsOrNot()
createConnection()
myConnection.Open()
myCommand = New SqlCommand("Select * from Contacts ",
myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
If TXT_FName.Text = dr(0).ToString() Then
foundFlag = 1
End If
End While
End Sub
Private Sub BTN_Save_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTN_Save.Click
checkIfExistsOrNot()
If TXT_FName.Text <> "" Then
If foundFlag = 0 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("INSERT INTO
[Contacts](firstName,lastName,cellNumber1,cellNumber2,residentialNumber1,
residentialNumber2,officeNumber,officeAddress,emergencyNumber,emailAddr
ess,homeAddress,birthDate,groupName) VALUES ('" & TXT_FName.Text &
"','" & TXT_LName.Text & "','" & TXT_CellNumber1.Text & "','" &
TXT_CellNumber2.Text & "','" & TXT_ResidenceNumber1.Text & "','" &
TXT_ResidenceNumber2.Text & "','" & TXT_OfficeNumber.Text & "','" &
TXT_OfficeAddress.Text & "','" & TXT_EmergencyNumber.Text & "','" &
Shankar_G
urjar
46. P a g e | 46
TXT_EmailAddress.Text & "','" & TXT_HomeAddress.Text & "','" &
TXT_BirthDate.Text & "','" & TXT_Group.Text & "')", myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY ADDED",
MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
showContactsInfo()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Else
MsgBox("CONTACT ALREADY EXISTS, CANNOT BE ADDED",
MsgBoxStyle.Information)
End If
Else
MsgBox("ENTER FIRST NAME FIRST", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Private Sub BTN_Update_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles BTN_Update.Click
checkIfExistsOrNot()
If foundFlag = 1 Then
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET
lastName ='" & TXT_LName.Text & "', cellNumber1 ='" &
TXT_CellNumber1.Text & "', cellNumber2 ='" & TXT_CellNumber2.Text &
"', residentialNumber1 ='" & TXT_ResidenceNumber1.Text & "',
residentialNumber2 ='" & TXT_ResidenceNumber2.Text & "', officeNumber
='" & TXT_OfficeNumber.Text & "', officeAddress ='" &
TXT_OfficeAddress.Text & "', emergencyNumber ='" &
TXT_EmergencyNumber.Text & "', emailAddress ='" &
TXT_EmailAddress.Text & "', homeAddress ='" & TXT_HomeAddress.Text &
"', birthDate ='" & TXT_BirthDate.Text & "', groupName ='" &
Shankar_G
urjar
47. P a g e | 47
TXT_Group.Text & "' where firstName = '" & TXT_FName.Text & "'",
myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY UPDATED",
MsgBoxStyle.Information)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
Else
MsgBox("YOU CANNOT UPDATE A CONTACT WHICH IS NOT
IN THE DATABASE, FIRST SAVE THAT CONTACT THEN YOU CAN
UPDATE", MsgBoxStyle.Information)
End If
foundFlag = 0
End Sub
Private Sub BTN_Rename_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles BTN_Rename.Click
Try
createConnection()
myConnection.Open()
myCommand = New SqlCommand("UPDATE Contacts SET firstName
='" & TXT_FName.Text & "' where firstName = '" & selectedStr & "'",
myConnection)
dr = myCommand.ExecuteReader()
MsgBox("SUCCESSFULLY RENAMED", MsgBoxStyle.Information)
CBO_Contacts.Text = ""
CBO_Contacts.Items.Clear()
LBOX_Contacts.Items.Clear()
fillComboBoxAndListBox()
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
End Try
End Sub
Private Sub LBL_SearchContacts_Click(sender As Object, e As EventArgs)
Handles LBL_SearchContacts.Click
Shankar_G
urjar
48. P a g e | 48
End Sub
Private Sub CBO_Contacts_SelectedIndexChanged(sender As Object, e As
EventArgs) Handles CBO_Contacts.SelectedIndexChanged
End Sub
End Class
Shankar_G
urjar
49. P a g e | 49
Chapter 7: Limitations and Future Application of
the Project
Limitations of the system: -
System works in all platforms and its compatible environments.
Advanced techniques are not used to check the authorization.
No Offline mode
Future Enhancements: -
It is not possible to develop a system that makes all the requirements of
the user. User requirements keep changing as the system is being used.
Some of the future enhancements that can be done to this system are:
As the technology emerges, it is possible to upgrade the system and
can be online.
Because it is based on object-oriented design, any further changes
can be easily adaptable.
Based on the future security issues, security can be improved using
emerging technologies.
GPS can be added
Online with OFFLINE mode.
Shankar_G
urjar
50. P a g e | 50
Conclusion
This application software has been computed successfully and was also
tested successfully by taking “test cases”. It is user friendly, and has required
options, which can be utilized by the user to perform the desired operations.
The software is developed using as front end and SQLite as back end in
Windows environment. The goals that are achieved by the software are:
Optimum utilization of resources.
Efficient management of records.
Simplification of the operations.
Less processing time and getting required information.
User friendly.
Portable and flexible for further enhancement.
Shankar_G
urjar
51. P a g e | 51
References/Bibliography
1. BCA5050: - Visual Programming– Practical
2.Telephone directory
https://en.wikipedia.org/wiki/Telephone_directory
Shankar_G
urjar