0% found this document useful (0 votes)
44 views17 pages

Term Paper of Topic: - Telephone Directory

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 17

TERM PAPER

Of
Cap407(v.b.net)
Topic: - TELEPHONE DIRECTORY

Submitted To: - Submitted By:-

Mr. pankaj sir Name:- Upender Thakur

Lect. lpu Roll No:-rd3802a28

Regd No:-10807347
Acknowledgement
It is not until you undertake the project like this one that you realize how
massive the effort it really is, or how much you must rely upon the
Selfless efforts and goodwill of others. There are many who helped us
with this project, and we want to thank them all from the core of our
Hearts.

We owe special words of thanks to our Teachers Mr. pankaj for their
vision, thoughtful counseling and encouragement at every step of the
project. We are also thankful to the teachers of the Department for
giving us the best of knowledge and guidance throughout the project.
And last but not the least, we find no words to acknowledge the financial
assistance & moral support rendered by our parents in making the effort
a success. All this has become reality because of their blessings and
above all by the grace of god.

Upender thakur

ROLL NO:-RD3802a28
TABLE OF CONTENTS
 INTRODUCTION

 OVERVIEW TO V.B.NET HISTORY OF V.B.NET:

 IMPORTANCE OF V.B.NET

 Introduction of TELEPHONE directory

 SYSTEM REQUIREMENTS

 coding
INTRODUCTION:

We have discussed so far various features of V.B.NET and are ready to


write and execute program of modest complexity. However, before
attempting to develop complex programs, it is worthwhile to consider
some programming techniques that would help design efficient and error
free.

The program development process includes three important stages,


namely, program design, program coding and program testing. All the
three stages contribute to the production of high quality program.

In “TELEPHONE DIRECTORY” we have done system design, source


coding, and program testing and added many more features to facilitate
the user with the best. We have given the user the facility to enter the
person’s record and providing the option to save and delete that record
and many more options.

We can improve the efficiency of the system, thus overcome the


drawbacks of the existing system.
· Less human error
· Strength and strain of manual labour can be reduced
· High security
· Data consistency
· Easy to handle
· Easy data updating
· Easy record keeping
· Backup data can be easily genera

OVERVIEW TO V.B.NET
HISTORY OF V.B.NET:

Visual Basic is a "visual programming" environment for developing Windows


(also Web now) applications. Visual Basic makes it possible to develop complicated
applications very quickly. The programmer designs windows graphically, drags
program elements from the Visual Basic Toolbox and writes basic code for each
element. Visual Basic is "event-driven" which means that procedures are called
automatically when the end user chooses menu items, clicks the mouse, moves
objects on the screen, etc.

Why is Visual Basic popular?

Programmers have undergone a major change in many years of programming


various machines. For example, what could take days to create an application in
other programming languages like C, C++ could be done in hours with Visual
Basic. Visual Basic provides many interesting sets of tools to aid us in building
exciting applications. Visual Basic provides these tools to make our life far more
easier because all the real hard code is already written for us.

Visual Basic is not only a programming language but also a true graphical
development environment. This environment allows programmers with little
programming experience to quickly develop powerful Windows applications.
Visual Basic also has the ability to develop programs that can be used as a front-
end application to a database system, serving as the user interface which collects user
input and displays formatted output in a more appealing and useful form.
Visual Basic is very popular for the ease with which it allows the programmer to
create nice looking graphical programs with less coding unlike many other
languages that take thousands of lines of programmer keyed code. As the
programmer works in the graphical environment much of the program code is
automatically generated by the Visual Basic program.

IMPORTANCE OF V.B.NET:

the name makes me feel that it is something special. In the History of Computing


world no other product sold more copies than Visual Basic did. Such is the
importance of that language which clearly states how widely it is used for
developing applications. Visual Basic is very popular for it's friendly working
(graphical) environment. Visual Basic. NET is an extension of Visual Basic
programming language with many new features in it. The changes from VB to
VB .NET are huge, ranging from the change in syntax of the language to the types
of projects we can create now and the way we design applications. Visual Basic
.NET was designed to take advantage of the .NET Framework base classes and
runtime environment. It comes with power packed features that simplify
application development.

Briefly on some changes:

The biggest change from VB to VB .NET is, VB .NET is Object-Oriented


now. VB .NET now supports all the key OOP features like Inheritance,
Polymorphism, Abstraction and Encapsulation. We can now create  classes and
objects, derive classes from other classes and so on. The major advantage of OOP
is code reusability
The Command Button now is Button and the TextBox is TextBox instead of Text
as in VB6
Many new controls have been added to the toolbar to make application
development more efficient
VB .NET now adds Console Applications to it apart from Windows and Web
Applications. Console applications are console oriented applications that run in the
DOS version
All the built-in VB functionality now is encapsulated in a Namespace (collection
of different classes) called System
New keywords are added and old one's are either removed or renamed
VB .NET is strongly typed which means that we need to declare all the variables
by default before using them
VB .NET now supports structured exception handling using Try...Catch...Finally
syntax
The syntax for procedures is changed. Get and Let are replaced by Get and Set
Event handling procedures are now passed only two parameters

Introduction of TELEPHONE directory


This Directory never be complete without These tools

 Pointer - Used to select and edit objects.


 Picture box - Display device which can contain bit-mapped pictures, text
and line drawings.
 Label - Used to display text that cannot be changed
 Text box - A text input device which accepts keyboard input and supports
editing.
 .Frame - An object which allows other controls to be arranged in logical
groups.
 Command button - Operates like a push button, which is pressed by
clicking the mouse on it.
 Option button - Used in a group of similar controls to select between a
numbers of mutually exclusive options.
 List box - Just like the list part of a combo box.
 Directory list box -Used to display files in a specified directory.
 File list box - Used to select a list of files by their attributes.
 Shape - Used to add objects such as circles, rectangles and rounded
boxes to a form.
 Image - Similar to picture box with less events. Used to display bitmaps.
 Data control - used to access DBs.
 ADO.NET - used to access with external Database
 Connection: Data Source name Which Create Connectivity

SYSTEM REQUIREMENTS

Operating System: Windows 2000/NT/Xp/Vista

RAM: 256 MB or more

HARD DISK 40 GB or more

Processor P3 or High

Compiler Standard C++ Compiler


SYSTEM DESCRIPTION

THE OPERATING SYSTEM USED IN THIS PROJECT IS


WINDOWSXPIT HAS MICROSOFT OFFICE INSTALLED IN IT. IT
HAS RAM OF 2GB. HARD DISK CAPACITY OF OPERATING
SYSTEM IS 250GB. IT CONSISTS OF PENTIUM-4
PROCESSOR.THE OPEREATING SYSTEM ALSO HAS C++
COMPILER. THE SYSTEM ALSO HAS TYPE CONVERSIONS
WHICH CONVERT LOWER TO UPPER TYPE. THE OPERATING
SYSTEM HAVE 1GB RAM FOR MICROSOFT WORLD.

Coding

Imports System.Data
Imports System.Data.SqlClient

PublicClass FRM_MainPage

Dim myConnection As SqlConnection


Dim myCommand As SqlCommand
Dim dr As SqlDataReader
Dim foundFlag AsInteger = 0
Sub createConnection()
myConnection = New SqlConnection("Server=HOME-
CEAB4BC482;DATABASE=PhoneBook;integrated security =
true;")
EndSub

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())
EndWhile
Catch ex As System.Exception

System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
EndTry
EndSub

PrivateSub FRM_MainPage_Load(ByVal sender As


System.Object, ByVal e As System.EventArgs)
HandlesMyBase.Load
fillComboBoxAndListBox()
EndSub

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()
TXT_BirthDate.Text = dr(11).ToString()
TXT_Group.Text = dr(12).ToString()
EndWhile
EndSub

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()
EndTry
EndSub

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()
EndTry
EndSub

Dim selectedStr AsString = Nothing

PrivateSub CBO_Contacts_SelectedValueChanged(ByVal
sender AsObject, ByVal e As System.EventArgs) Handles
CBO_Contacts.SelectedValueChanged
showContactsInComboBox()
EndSub

PrivateSub LBOX_Contacts_SelectedIndexChanged(ByVal
sender As System.Object, ByVal e As System.EventArgs)
Handles LBOX_Contacts.SelectedIndexChanged
showContactsInListBox()
selectedStr = LBOX_Contacts.SelectedItem
EndSub

PrivateSub BTN_Exit_Click(ByVal sender As


System.Object, ByVal e As System.EventArgs) Handles
BTN_Exit.Click
End
EndSub

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()
EndSub

PrivateSub 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()
EndTry
EndSub

PrivateSub BTN_Add_Click(ByVal sender As System.Object,


ByVal e As System.EventArgs) Handles BTN_Add.Click
clearAll()
EndSub

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
EndIf
EndWhile
EndSub

PrivateSub 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,residential
Number1,residentialNumber2,officeNumber,officeAddress,e
mergencyNumber,emailAddress,homeAddress,birthDate,group
Name) 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()
EndTry
Else
MsgBox("CONTACT ALREADY EXISTS, CANNOT
BE ADDED", MsgBoxStyle.Information)
EndIf
Else
MsgBox("ENTER FIRST NAME FIRST",
MsgBoxStyle.Information)
EndIf
foundFlag = 0
EndSub

PrivateSub 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()
EndTry
Else
MsgBox("YOU CANNOT UPDATE A CONTACT WHICH
IS NOT IN THE DATABASE, FIRST SAVE THAT CONTACT THEN
YOU CAN UPDATE", MsgBoxStyle.Information)
EndIf
foundFlag = 0
EndSub

PrivateSub 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()
EndTry
EndSub

EndClass

You might also like