0% found this document useful (0 votes)
48 views38 pages

Dot Net Record

The program displays employee details using constructor and member functions. It reads employee details from a list box and displays the selected item details like name, salary, designation and experience in text boxes on click of a button.

Uploaded by

sparklethiru23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views38 pages

Dot Net Record

The program displays employee details using constructor and member functions. It reads employee details from a list box and displays the selected item details like name, salary, designation and experience in text boxes on click of a button.

Uploaded by

sparklethiru23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

SRI VASAVI COLLEGE, ERODE

(SELF-FINANCE WING)
ERODE-638 316

DEPARTMENT OF INFORMATION TECHNOLOGY


DOT NET PROGRAMMING

RECORD NOTE BOOK

NAME :

REGISTER NO :

CLASS :
SRI VASAVI COLLEGE, ERODE
(SELF-FINANCE WING)
ERODE-638 316

DEPARTMENT OF INFORMATION TECHNOLOGY


DOT NET PROGRAMMING

REGISTER NO:
This is to certify that this record work is done by
of III-B.sc (IT) at the Department of Information Technology in Sri Vasavi College
[Self-Finance Wing], Erode during the VI Semester of the academic year 2019-2020.

STAFF IN CHARGE HEAD OF THE DEPARTMENT

Submitted for the Practical Examination held on at the Department


of Information Technology in Sri Vasavi College [Self-Finance Wing], Erode.

STATION : ERODE
DATE :

INTERNAL EXAMINER EXTERNAL EXAMINER


INDEX

S.NO DATE TITLE PAGE NO.

ADDING STRING FROM TEXTBOX AND


1. 10-12-2019 1-4
MOVING TO COMBOBOX

2. 18-12-2019 TREEVIEW CONTROL 5-8

3. 07-01-2020 USER DEFINED EXCEPTION 9-13

EMPLOYEE DETAILS USING CONSTRUCTOR


4. 21-01-2020 14-17
AND MEMBER FUNCTION

5. 04-02-2020 EVENT HANDLING 18-21

6. 11-02-2020 MENUS AND MENU ITEMS 22-26

7. 18-02-2020 STUDENT DATABASE CONNECTIVITY 27-31

8. 03-03-2020 DISPLAYING CURRENT DATE AND TIME 32-35


EX.NO : 1 ADDING STRING FROM TEXTBOX

DATE : 10.12.2019 TO COMBOBOX

AIM:

To create an application to add a string to the textbox and move the same string to the
combo box when user clicks the button.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 3 Labels, 2 Textboxes, 1 Combo Box and 2 Buttons in the form and change their
properties as per your preference.

STEP 5: Double click the button and write the program code to add string to textbox and move the
same text to combo box.

STEP 6: Execute the program and display the results.

STEP 7: Stop the process.

1
FORM DESIGN:

2
CODING:

Public Class Form1

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


Handles Button1.Click

ComboBox1.Items.Add(TextBox1.Text + “_” + TextBox2.Text + “ “ + “at” + “ “ + DateAndTime.Now)

End Sub

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


Handles Button2.Click

TextBox1.Text=””

TextBox2.Text=””

End Sub

End Class

3
OUTPUT:

4
EX.NO : 2

DATE : 18.12.2019 TREEVIEW CONTROL

AIM:

To create an application in VB.NET to display hierarchical representation of items with


Tree View Control using runtime coding .

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 2 Labels, 2 Tree View Controls and 2 Buttons in the form and customize their
properties.

STEP 5: Write the coding to display the hierarchical view of items with tree view control.

STEP 6: Execute the program and display the results.

STEP 7: Stop the process.

5
FORM DESIGN:

6
CODING:

Public Class Form1

Private ARRUG(5)
Private ARRPG(5)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load

ARRUG(0)=”BSC(IT)”
ARRUG(1)=”BSC(CS)”
ARRUG(2)=”BSC(CDF)”
ARRUG(3)=”BCOM(CA)”
ARRUG(4)=”BCA”
ARRPG(0)=”MSC(IT)”
ARRPG(1)=”MCA”
ARRPG(2)=”MSC(CS)”
ARRPG(3)=”M.COM(CA)”
ARRPG(4)=”MSC(ELEX)”
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click

Dim AAA As String


For Each AAA in ARRUG
TreeView2.Nodes(0).Nodes.Add(AAA)
Next
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click

Dim BBB As String


For Each BBB in ARRPG
TreeView2.Nodes(1).Nodes.Add(BBB)
Next
End Sub
End Class

7
OUTPUT:

8
EX.NO : 3
DATE : 07.01.2020 USER DEFINED EXCEPTION

AIM:

To create a VB.NET program to handle errors using User Defined Exception.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 4 Labels, 3 Textboxes, 5 Buttons in the form.

STEP 5: Double click the button and write the coding using Try and Catch Exception

STEP 6: Execute the program and display the results.

STEP 7: Stop the process.

9
FORM DESIGN:

10
CODING:

Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim fn As Double
Dim sn As Double
Dim number As Double
Try
fn=Me.TextBox1.Text
sn=Me.TextBox2.Text
number=fn+sn
Me.TextBox3.Text=number
Catch ex As Exception
MsgBox(ex.Message & vbCrLf & “The operation could not be performed since the number you provided
is invalid”, MsgBoxStyle.OkOnly, “Invalid Operation”)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Dim fn As Double
Dim sn As Double
Dim number As Double
Try
fn=Me.TextBox1.Text
sn=Me.TextBox2.Text
number=fn-sn
Me.TextBox3.Text=number
Catch ex As Exception
MsgBox(ex.Message & vbCrLf & “The operation could not be performed since the number you provided
is invalid”, MsgBoxStyle.OkOnly, “Invalid Operation”)
End Try
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
Dim fn As Double
Dim sn As Double

11
Dim number As Double
Try
fn=Me.TextBox1.Text
sn=Me.TextBox2.Text
number=fn*sn
Me.TextBox3.Text=number
Catch ex As Exception
MsgBox(ex.Message & vbCrLf & “The operation could not be performed since the number you provided
is invalid”, MsgBoxStyle.OkOnly, “Invalid Operation”)
End Try
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
Dim fn As Double
Dim sn As Double
Dim number As Double
Try
fn=Me.TextBox1.Text
sn=Me.TextBox2.Text
number=fn/sn
Me.TextBox3.Text=number
Catch ex As Exception
MsgBox(ex.Message & vbCrLf & “The operation could not be performed since the number you provided
is invalid”, MsgBoxStyle.OkOnly, “Invalid Operation”)
End Try
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button5.Click
TextBox1.Text=””
TextBox2.Text=””
TextBox3.Text=””
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button6.Click
End
End Sub
End Class
12
OUTPUT:

13
EX.NO : 4 EMPLOYEE DETAILS USING CONSTRUCTOR

DATE : 21.01.2020 AND MEMBER FUNCTION

AIM:

To create a VB.NET program which reads and displays the Employee Details using
constructor and member functions.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 4 Labels, 3 Textboxes, 1 List box in the form and customize the properties.

STEP 5: In Solution Explorer, right click the project and click Add  Class.

STEP 6: Write the coding in class using New() constructor

STEP 7: Execute the program and display the results.

STEP 8: Stop the process.

14
FORM DESIGN:

15
CODING:

Public Class Form1

Public Sub New()

MyBase.New()

‘This call is required by the Windows Form Designer.

InitializeComponent()

‘Add any initialization after the initializeComponent() call.

ListBox1.Items.Add(“MOORTHI,BP-50000,DES_HR,EXPERIENCE-4 Years”)

ListBox1.Items.Add(“MUTHU,BP-40000,DES_HR,EXPERIENCE-3 Years”)

ListBox1.Items.Add(“SADHAM,BP-80000,DES_HR,EXPERIENCE-5 Years”)

ListBox1.Sorted=True

End Sub

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


System.EventArgs) Handles ListBox1.SelectedIndexChnaged

TextBox1.Text=ListBox1.Items.Count

TextBox2.Text=ListBox1.SelectedIndex

TextBox3.Text=ListBox1.SelectedItem

End Sub

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


Handles Button1.Click

TextBox1.Text=””

TextBox2.Text=””

TextBox3.Text=””

End Sub

End Class

16
OUTPUT:

17
EX.NO : 5

DATE : 04.02.2020 EVENT HANDLING

AIM:

To create a VB.NET program to demonstrate the events such as

1. Click

2. Mouse Down

3. Down Key

4. Form Load

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 3 Labels, 2 Textboxes and 2 Buttons in the form design and customize their
properties.

STEP 5: Create the events for Click, Mouse Down, Down Key and Form Load.

STEP 6: Execute the program and display the results.

STEP 7: Stop the process.

18
FORM DESIGN:

19
CODING:

Public Class Form1

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


Handles Button1.Click

MsgBox(“Record Saved Successfully”)

End Sub

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


MyBase.Load

MsgBox(“Your Entry Time Is:” +DateAndTime.Now)

Label3.Text=DateAndTime.Now

End Sub

Private Sub TextBox2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.


KeyEventArgs) Handles TextBox2.KeyDown

If e.KeyCode=Keys.Down Then

Me.Close()

End If

End Sub

Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.


MouseEventArgs) Handles Me.MouseDown

Me.BackColor=Color.Cyan

MsgBox(“Enter Your Details Below”)

End Sub

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


Handles Button2.Click

End

End Sub

End Class

20
OUTPUT:

21
EX.NO : 6

DATE : 11.02.2020 MENUS AND MENU ITEMS

AIM:

To create an application in VB.NET for the file menu with menu items such as Open, Save,
Print and edit menu items such as Cut, Copy, Paste, Undo and Redo.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place Context Menu Strip, Tool Strip, Print Dialog, Print Document, Open File Dialog
and Save File Dialog.

STEP 5: Right click the Menu Strip Tool and select insert standard items.

STEP 6: Write the codes for each and every menus and menu items.

STEP 7: Place Rich Text Box in the form.

STEP 8: Execute the program and display the results.

STEP 9: Stop the process.

22
FORM DESIGN:

23
CODING:

Public Class Form1


Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NewToolStripMenuItem.Click
RichTextBox1.Clear()
End Sub

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


System.EventArgs) Handles SaveToolStripMenuItem.Click
SaveFileDialog1.Filter=”TextFiles(*.txt)|*.txt|Document(*.doc)|*.doc”
If SaveFileDialog1.ShowDialog=Windows.Forms.DialogResult.OK Then
RichTextBox1.SaveFile(SaveFileDialog1.FileName, RichTextBoxStreamType.PlainText)
End If

End Sub
Private Sub UndoToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles UndoToolStripMenuItem.Click
RichTextBox1.Undo()
End Sub

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


System.EventArgs) Handles RedoToolStripMenuItem.Click
RichTextBox1.Redo()
End Sub

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


System.EventArgs) Handles CutToolStripMenuItem.Click
RichTextBox1.Cut()
End Sub

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


System.EventArgs) Handles CopyToolStripMenuItem.Click

RichTextBox1.Copy()
End Sub

24
Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles PasteToolStripMenuItem.Click
RichTextBox1.Paste()
End Sub

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


System.EventArgs) Handles OpenToolStripButton.Click
OpenFileDialog1.Filter=”TextFiles(*.txt)|*.txt|Document(*.doc)|*.doc”
If OpenFileDialog1.ShowDialog()=Windows.Forms.DialogResult.OK
Then
RichTextBox1.LoadFile(OpenFileDialog1.FileName, RichTextBoxStreamType.PlainText)
End If
End Sub

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


System.EventArgs) Handles OpenToolStripMenuItem.Click
OpenFileDialog1.Filter=”TextFiles(*.txt)|*.txt|Document(*.doc)|*.doc”
If OpenFileDialog1.ShowDialog()=Windows.Forms.DialogResult.OK
Then
RichTextBox1.LoadFile(OpenFileDialog1.FileName, RichTextBoxStreamType.PlainText)
End If
End Sub

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


System.EventArgs) Handles PrintToolStripButton.Click
If PrintDialog1.ShowDialog()=Windows.Forms.DialogResult.Ok Then
PrintDocument1.PrinterSettings=PrintDialog1.PrinterSettings
PrintDocument1.Print()

End If
End Sub
End Class

25
OUTPUT:

26
EX.NO : 7

DATE : 18.02.2020 STUDENT DATABASE CONNECTIVITY

AIM:

To create a VB.NET program to maintain the Student Database that connects with
Microsoft Access for adding, retrieving, viewing and updating the data.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008  Create New
Project.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 6 Labels, 6 Text Boxes, 5 Buttons in the form and customize the properties.

STEP 5: Open Microsoft Access and create the following fields: Roll_No, Stud_Name, Reg_No,
Total_Marks, Average and Remarks.

STEP 6: Save the table

STEP 7: In VB.NET Project Window, right click the Server Explorer.

STEP 8: Make the test connection success and write the code for each button.

STEP 9: Execute the program and display the result.

STEP 10: Stop the process.

27
FORM DESIGN:

FRONT-END (VB.NET)

BACK-END (MS-ACCESS)

28
CODING:

Public Class Form1


Dim cmd As New OleDb.OleDbCommand
Dim con As New OleDb.OleDbConnection
Dim dr As OleDb.OleDbdataReader
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load
Con.ConnectionString=”Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and
Settings\Vasavi\My Documents\Database1.accdb”
con.Open()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
cmd.Connection=con
cmd.CommandText=”Insert into table2 values(“& TextBox1.Text & “,”& TextBox2.Text &”,” &
TextBox3.Tex t &”,” & TextBox4.Text &”,”& TextBox5.Text &”,”& TextBox6.Text &”,”&
TextBox7.Text &”)”
cmd.ExecuteNonQuery()
MsgBox(“Saved”)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
Dim cmd As New OleDb.OleDbCommand(“Select * from table2”, con)
cmd.Connection=con
cmd.CommandText=”Select * from table2 where rollno=” & TextBox1.Text & “ “
cmd.ExecuteNonQuery()
dr=cmd.executeReader
While dr.Read
Textbox1.Text=dr.GetValue(0)
Textbox2.Text=dr.GetValue(1)
Textbox3.Text=dr.GetValue(2)
Textbox4.Text=dr.GetValue(3)
Textbox5.Text=dr.GetValue(4)
Textbox6.Text=dr.GetValue(5)
End While

29
MsgBox(“Displayed”)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button3.Click
cmd.Connection=con
cmd.CommandText=”Update table2 set Stud_Name “& TextBox2.Text &”, Reg_No=”& TextBox3.Text
&”, Total_Marks=”& TextBox4.Text &”, Average=”& TextBox5.Text &”,Remarks=”& TextBox6.Text
&” &”Where rollno=”& TextBox1.Text &””
cmd.ExecuteNonQuery()
MsgBox(“Updated”)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button4.Click
cmd.connection=con
cmd.CommandText=”Delete from table2 where rollno=” & TextBox1.Text & “”
cmd.ExecuteNonQuery()
TextBox1.Text=””
TextBox2.Text=””
TextBox3.Text=””
TextBox4.Text=””
TextBox5.Text=””
TextBox6.Text=””
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button5.Click
TextBox1.Text=””
TextBox2.Text=””
TextBox3.Text=””
TextBox4.Text=””
TextBox5.Text=””
TextBox6.Text=””
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button6.Click
End
End Sub
End Class
30
OUTPUT:

VB.NET (FRONT-END)

MS-ACCESS (BACK-END)

31
EX.NO : 8

DATE : 03.03.2020 DISPLAYING CURRENT DATE AND TIME

AIM:

To create an ASP.NET program to display current date and time.

ALGORITHM:

STEP 1: Start the process.

STEP 2: Navigate to Start  All Programs  Microsoft Visual Studio 2008 Click Create New
Website.

STEP 3: Click Windows Form Application and rename the project in the dialog box and click OK.

STEP 4: Place 5 Labels, 9 Textboxes and 1 Button in the form and customize their properties.

STEP 5: Double click the button and write the coding to display current date and time.

STEP 6: Execute the program and display the result.

STEP 7: Stop the process.

32
FORM DESIGN:

33
CODING:

Partial Class_Default

Inherits System.Web.UI.Page

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


Button1.Click

TextBox1.Text=DateAndTime.Now

TextBox2.Text=”2567”

TextBox3.Text=”Chennai Express”

TextBox4.Text=”04.30 AM”

TextBox5.Text=”09.30 PM”

TextBox6.Text=”2568”

TextBox7.Text=”Blue Mountain”

TextBox8.Text=”04.30 PM”

TextBox9.Text=”06.30 AM”

End Sub

End Class

34
OUTPUT:

35

You might also like