Term Paper of Topic: - Telephone Directory
Term Paper of Topic: - Telephone Directory
Term Paper of Topic: - Telephone Directory
Of
Cap407(v.b.net)
Topic: - TELEPHONE DIRECTORY
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
IMPORTANCE OF V.B.NET
SYSTEM REQUIREMENTS
coding
INTRODUCTION:
OVERVIEW TO V.B.NET
HISTORY OF V.B.NET:
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:
Briefly on some changes:
SYSTEM REQUIREMENTS
Processor P3 or High
Coding
Imports System.Data
Imports System.Data.SqlClient
PublicClass FRM_MainPage
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
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
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
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
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
EndTry
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
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
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
System.Windows.Forms.MessageBox.Show(ex.Message)
Finally
dr.Close()
myConnection.Close()
EndTry
EndSub
EndClass