Practical - IV Web Programming Lab
Practical - IV Web Programming Lab
Practical - IV Web Programming Lab
(PRIDE)
PERIYAR UNIVERSITY
SALEM - 636 011.
1
Prepared by :
Dr. I. LAURENCE AROQUIARAJ
Assistant Professor
Department of Computer Science
Periyar University
Periyar Palkalai Nagar
Salem – 636 011.
2
M.Sc. COMPUTER SCIENCE
SECOND YEAR
PRACTICAL - IV : WEB PROGRAMMING LAB
3
VB.NET
Ex.No:1
Creating and using Variables Arrays and Structures
AIM:-
To write a program for Creating and using Variables, Arrays and
Structures in VB.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok .
STEP3 : Open form1 and place the Textbox and Buttons Control for the
click Events.
STEP4 : Write the code in Form1 inside the controls
STEP5 : Save the Application
STEP6 : Run the Application
STEP7 : Stop the Project.
Source Code:-
Dim I As Integer
Dim emp(25) As employee
Structure employee
Dim rn As Integer
Dim name As String
Dim sal As Decimal
Dim add As String
Dim mbl As Long
End Structure
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles display.Click
Dim j As Integer
Dim ds As New DataSet("Mydb")
Dim dtbl As New DataTable("Team Data")
dtbl.Columns.Add("Rno", GetType(Integer))
dtbl.Columns.Add("Name", GetType(String))
dtbl.Columns.Add("Salary", GetType(Decimal))
4
dtbl.Columns.Add("Address", GetType(String))
dtbl.Columns.Add("MobileNo", GetType(Long))
ds.Tables.Add(dtbl)
For j = 0 To I
Dim dr As DataRow = dtbl.NewRow()
dr(0) = emp(j).rn
dr(1) = emp(j).name
dr(2) = emp(j).sal
dr(3) = emp(j).add
dr(4) = emp(j).mbl
dtbl.Rows.Add(dr)
Next
DataGridView1.DataSource = ds.Tables("Team Data").DefaultView
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles save.Click
emp(I).rn = TextBox1.Text
emp(I).name = TextBox2.Text
emp(I).sal = TextBox3.Text
emp(I).add = TextBox4.Text
emp(I).mbl = TextBox5.Text
I += 1
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
MsgBox("Successfully Added The Records....")
End Sub
5
Output:-
Result:-
Thus the above creating and using variables arrays and structures
Program has been executed successfully.
6
Ex.No:2
Creating and using Procedures
AIM:-
To write a program for Creating and using Procedures in VB.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok.
STEP3 : Open form1 and place the Textbox and Buttons Control for the
click Events.
STEP4 : Write the code in the procedure
STEP5 : Save the Application
STEP6 : Run the Application
STEP7 : Stop the Project.
Source Code:-
Public Class Form1
Dim num As Double
Dim num1 As Double
Dim mem As Double
Dim op As Integer
Dim res As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text & 1
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Text = TextBox1.Text & 2
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
TextBox1.Text = TextBox1.Text & 3
End Sub
7
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
TextBox1.Text = TextBox1.Text & 4
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button5.Click
TextBox1.Text = TextBox1.Text & 5
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button6.Click
TextBox1.Text = TextBox1.Text & 6
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button7.Click
TextBox1.Text = TextBox1.Text & 7
End Sub
Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button8.Click
TextBox1.Text = TextBox1.Text & 8
End Sub
Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button9.Click
TextBox1.Text = TextBox1.Text & 9
End Sub
Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button16.Click
TextBox1.Text = TextBox1.Text & 0
End Sub
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button10.Click
num = Val(TextBox1.Text)
TextBox1.Text = ""
op = 1
End Sub
8
Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button11.Click
num = Val(TextBox1.Text)
TextBox1.Text = ""
op = 2
End Sub
Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button12.Click
num = Val(TextBox1.Text)
TextBox1.Text = ""
op = 3
End Sub
Private Sub Button13_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button13.Click
num = Val(TextBox1.Text)
TextBox1.Text = ""
op = 4
End Sub
Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button14.Click
TextBox1.Text = TextBox1.Text & "."
End Sub
Private Sub Button15_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button15.Click
num1 = Val(TextBox1.Text)
Select Case op
Case 1
res = num + num1
Case 2
res = num - num1
Case 3
res = num * num1
Case 4
res = num / num1
End Select
9
TextBox1.Text = res
End Sub
Private Sub Button17_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button17.Click
mem = 0
End Sub
Private Sub Button18_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button18.Click
mem = mem + Val(TextBox1.Text)
End Sub
Private Sub Button19_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button19.Click
TextBox1.Text = mem
TextBox1.Text = ""
End Sub
Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button20.Click
TextBox1.Text = ""
End Sub
End Class
Output:-
Result:-
Thus the above creating and using Procedures Program has been
Executed successfully.
10
Ex.No:3
Decision Structure
AIM:-
To write a program for Decision Structures in VB.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok.
STEP3 : Open form1 and place the Radio Buttons, Label Control for the
click Events.
STEP4 : Write the code in Form1 inside the controls
STEP5 : Save the Application
STEP6 : Run the Application
STEP7 : Stop the Project.
Source Code:-
Public Class Form1
Dim nxt As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Label5.Text = "300"
nxt = 0
Timer1.Enabled = True
Label2.Text = "Q1. The Brain of any System is?"
RadioButton1.Text = "CPU"
RadioButton2.Text = "ALU"
RadioButton3.Text = "Memory"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Select Case nxt
Case 0
If RadioButton1.Checked = True Then
Label3.Text = Val(Label3.Text) + 10
Else
11
MessageBox.Show("Wrong Answer")
End If
Case 1
If RadioButton2.Checked = True Then
Label3.Text = Val(Label3.Text) + 10
Else
MessageBox.Show("Wrong Answer")
End If
Case 2
If RadioButton3.Checked = True Then
Label3.Text = Val(Label3.Text) + 10
Else
MessageBox.Show("Wrong Answer")
End If
Case 3
If RadioButton2.Checked = True Then
Label3.Text = Val(Label3.Text) + 10
Else
MessageBox.Show("Wrong Answer")
End If
Case 4
If RadioButton1.Checked = True Then
Label3.Text = Val(Label3.Text) + 10
Else
MessageBox.Show("Wrong Answer")
End If
End Select
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
nxt = nxt + 1
12
Select Case nxt
Case 1
Label2.Text = "Q2. Which of the following Language used in AI"
RadioButton1.Text = "FORTRAN"
RadioButton2.Text = "PROLOG"
RadioButton3.Text = "COBOL"
Case 2
Label2.Text = "Q3.Java is Platform"
RadioButton1.Text = "Dependent"
RadioButton2.Text = "Exdependent"
RadioButton3.Text = "Independent"
Case 3
Label2.Text = "Q4.Which of the Following is a Presentation
Program?"
RadioButton1.Text = "MS-Word"
RadioButton2.Text = "MS-Excel"
RadioButton3.Text = "MS-PowerPoint"
Case 4
Label2.Text = "Q5. WWW stands for"
RadioButton1.Text = "World Worm Web"
RadioButton2.Text = "World Wide Web"
RadioButton3.Text = "World Word Web"
End Select
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 Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
If Label5.Text > 0 Then
Label5.Text = Val(Label5.Text) - 1
Else
Label5.Text = 0
13
Timer1.Stop()
MsgBox("Sorry Time Up")
MsgBox("Your Score is:" & Label3.Text)
End If
End Sub
End Class
Output:-
Result:-
Thus the above Decision Structures Program has been executed
Successfully.
14
Ex.No:4
Exception Handling
AIM:-
To write a program Exception Handling in VB.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok .
STEP3 : Open form1 and place the Textbox and Buttons Control for the
click Events.
STEP4 : Write the code in Form1
STEP5 : Save the Application using in Exception Handling
STEP6 : Run the Application
STEP7 : Stop the Project.
Source Code:-
Public Class Form1
Dim a, b, c As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
a = TextBox1.Text
b = TextBox2.Text
Try
c=a+b
TextBox3.Text = c
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
a = TextBox1.Text
b = TextBox2.Text
Try
TextBox3.Text = c
15
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
a = TextBox1.Text
b = TextBox2.Text
Try
c=a*b
TextBox3.Text = c
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
a = TextBox1.Text
b = TextBox2.Text
Try
c=a/b
TextBox3.Text = c
Catch ex As Exception
MessageBox.Show(ex.Message)
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
End Class
16
Output:-
Result:-
Thus the above Exception Handling Program has been executed
successfully.
17
Ex.No:5
Menu Editor
AIM:-
To write a program for Menu Editor in VB.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok
STEP3 : Open form1 and place the Text area and Menu Strip for menu
Access
STEP4 : Adding Main menu and sub menus
STEP5 : Double click the form and write code
STEP6 : Save the Application and Run the Application
STEP7 : Stop the Project.
Source Code:-
Public Class Form1
Dim k(500), d As String
Dim i As Integer
Dim c As Integer = 1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
ToolStripStatusLabel1.Text = DateAndTime.Now.ToString
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
RichTextBox1.Visible = False
Timer1.Start()
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
RichTextBox1.Visible = True
RichTextBox1.Text = ""
RichTextBox1.Focus()
End Sub
18
Private Sub CutToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CutToolStripMenuItem.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.Cut()
Else
MsgBox("Select the string")
End If
End Sub
Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.Copy()
Else
MsgBox("Select the string")
End If
End Sub
Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click
RichTextBox1.Paste()
End Sub
Private Sub DeleteToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
DeleteToolStripMenuItem1.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.SelectedText = ""
Else
MsgBox("Select the string")
End If
End Sub
Private Sub SelectAllToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
SelectAllToolStripMenuItem.Click
RichTextBox1.SelectAll()
End Sub
19
Private Sub ToolStripLabel2_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs)
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.Copy()
Else
MsgBox("Select the string")
End If
End Sub
Private Sub FontToolStripMenuItem2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Dim f As New FontDialog
f.ShowDialog()
For Each aaa As Control In Me.Controls
RichTextBox1.Font = f.Font
Next
End Sub
Private Sub BackColorToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
BackColorToolStripMenuItem.Click
If (CD.ShowDialog() = DialogResult.OK) Then
RichTextBox1.BackColor = CD.Color
End If
End Sub
Private Sub ForeColorToolStripMenuItem1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ForeColorToolStripMenuItem1.Click
If (CD.ShowDialog() = DialogResult.OK) Then
RichTextBox1.ForeColor = CD.Color
End If
End Sub
Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click
OpenFD.Filter = "All Files|*.*|Text Files|*.txt;*.c;*.cpp;*.cs;*.java"
If (OpenFD.ShowDialog() = DialogResult.OK) Then
RichTextBox1.Show()
20
RichTextBox1.LoadFile(OpenFD.FileName,
RichTextBoxStreamType.RichText)
End If
End Sub
Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ListBox2.SelectedIndexChanged
RichTextBox1.SelectionFont = New Font(ListBox2.Text, DefaultFont.Size)
End Sub
Private Sub RichTextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles
RichTextBox1.KeyPress
ToolStripStatusLabel4.Text = "STRING LENGTH: " +
RichTextBox1.TextLength.ToString()
k(i) = e.KeyChar.ToString
If e.KeyChar.ToString = Chr(8) And i > 0 Then
i=i-1
If k(i - 2).ToString = Chr(32) Then
c -= 1
d = Chr(32)
End If
Else
'MsgBox(Asc(e.KeyChar))
For Each b As String In e.KeyChar.ToString
i += 1
If d = Chr(32) And b >= Chr(65) And b <= Chr(91) Then
c += 1
21
Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
SaveFD.Filter = "All Files|*.*"
If (SaveFD.ShowDialog() = DialogResult.OK) Then
RichTextBox1.SaveFile(SaveFD.FileName,
RichTextBoxStreamType.RichText)
End If
End Sub
Private Sub RedoToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles RedoToolStripMenuItem.Click
RichTextBox1.Undo()
End Sub
Private Sub RedoToolStripMenuItem1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles RedoToolStripMenuItem1.Click
RichTextBox1.Redo()
End Sub
Private Sub BoldToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles BoldToolStripMenuItem.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Bold)
RichTextBox1.Focus()
End If
End Sub
Private Sub ItalicToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ItalicToolStripMenuItem.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Italic)
RichTextBox1.Focus()
End If
End Sub
Private Sub UnderlineToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
UnderlineToolStripMenuItem.Click
22
If RichTextBox1.Text <> "" Then
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Underline)
RichTextBox1.Focus()
End If
End Sub
Private Sub RegularToolStripMenuItem_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
RegularToolStripMenuItem.Click
If RichTextBox1.Text <> "" Then
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Regular)
RichTextBox1.Focus()
End If
End Sub
23
Private Sub CenterToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CenterToolStripMenuItem.Click
RichTextBox1.SelectionAlignment = HorizontalAlignment.Center
End Sub
24
End If
End Sub
Private Sub ToolOpen_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolOpen.Click
OpenFD.Filter = "All Files|*.*|Text Files|*.txt;*.c;*.cpp;*.cs;*.java"
If (OpenFD.ShowDialog() = DialogResult.OK) Then
RichTextBox1.Show()
RichTextBox1.LoadFile(OpenFD.FileName,
RichTextBoxStreamType.RichText)
End If
End Sub
Private Sub Toolclose_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Toolclose.Click
End
End Sub
Private Sub ToolBold_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolBold.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Bold)
RichTextBox1.Focus()
End If
End Sub
Private Sub ToolItalic_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolItalic.Click
If RichTextBox1.SelectedText <> "" Then
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Italic)
RichTextBox1.Focus()
End If
End Sub
Private Sub ToolU_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolU.Click
If RichTextBox1.Text <> "" Then
25
RichTextBox1.SelectionFont = New Font(RichTextBox1.SelectionFont,
FontStyle.Underline)
RichTextBox1.Focus()
End If
End Sub
Private Sub Toolundo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Toolundo.Click
RichTextBox1.Undo()
End Sub
Private Sub ToolRedo_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ToolRedo.Click
RichTextBox1.Redo()
End Sub
Private Sub CloseToolStripMenuItem1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles CloseToolStripMenuItem1.Click
RichTextBox1.Visible = False
End Sub
Private Sub InsImage_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles InsImage.Click
OpenFD.Filter = "All files |*.*"
OpenFD.Multiselect = True
Dim orgdata = Clipboard.GetDataObject
If OpenFD.ShowDialog = Windows.Forms.DialogResult.OK Then
For Each fname As String In OpenFD.FileNames
Dim img As Image = Image.FromFile(fname)
Clipboard.SetImage(img)
RichTextBox1.Paste()
Next
End If
Clipboard.SetDataObject(orgdata)
End Sub
End Class
26
Output:-
Result:-
Thus the above Menu Editor Program has been executed successfully.
27
Ex.No:6
Create and Open Database Using ADO.NET
AIM:-
To write a program for Create and Open Database Using ADO.NET
in VB.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok
STEP3 : Open form1 and place the Text Box and labels
STEP4 : The button for insert, delete, update, exit
STEP5 : Create a Database in MS Access
STEP6 : Save the Application and Run the Application
STEP7 : Stop the Project.
Source Code:-
Public Class Form1
Dim con As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim d As OleDb.OleDbDataReader
Dim str As String
Dim n, i, a, x As Integer
Dim emp(15) As EMP
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Dim z As Integer
Try
con = New
OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=E:\Programs\MCA\Sem V\.NET\EX6\ex6.accdb")
con.Open()
str = "insert into tbl_ex6 values ('" & TextBox1.Text & "','" &
TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" &
TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" &
TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "') "
cmd = New OleDb.OleDbCommand(str, con)
28
z = cmd.ExecuteNonQuery
MsgBox("Inserted Successfully")
Catch ex As Exception
End Try
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles
Button4.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
TextBox9.Text = ""
TextBox10.Text = ""
TextBox1.Focus()
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles
Button5.Click
End
End Sub
Private Sub TextBox4_TextChanged(sender As Object, e As EventArgs)
Handles TextBox4.TextChanged
If Val(TextBox4.Text) <= 5000 Then
TextBox5.Text = Val(TextBox4.Text) * 2 / 100
TextBox6.Text = Val(TextBox4.Text) * 3 / 100
TextBox7.Text = Val(TextBox4.Text) * 2 / 100
TextBox8.Text = Val(TextBox4.Text) * 2 / 100
ElseIf Val(TextBox4.Text) < 2000 Then
TextBox5.Text = Val(TextBox4.Text) * 3 / 100
TextBox6.Text = Val(TextBox4.Text) * 4 / 100
TextBox7.Text = Val(TextBox4.Text) * 3 / 100
29
TextBox8.Text = Val(TextBox4.Text) * 3 / 100
Else
TextBox5.Text = Val(TextBox4.Text) * 4 / 100
TextBox6.Text = Val(TextBox4.Text) * 5 / 100
TextBox7.Text = Val(TextBox4.Text) * 4 / 100
TextBox8.Text = Val(TextBox4.Text) * 4 / 100
End If
End Sub
Private Sub TextBox6_TextChanged(sender As Object, e As EventArgs)
Handles TextBox6.TextChanged
TextBox9.Text = Val(TextBox4.Text) + Val(TextBox5.Text) +
Val(TextBox6.Text)
TextBox10.Text = Val(TextBox9.Text) - Val(TextBox8.Text) -
Val(TextBox7.Text)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Button2.Click
Dim z As Integer
Try
con = New
OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=E:\Programs\MCA\Sem V\.NET\EX6\ex6.accdb")
con.Open()
cmd = New OleDb.OleDbCommand("delete * from tbl_ex6 where
fld_eid=" & Val(TextBox1.Text) & ")", con)
z = cmd.ExecuteNonQuery
MsgBox("Record Deleted")
Catch ex As Exception
End Try
con.Close()
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles
Button3.Click
Try
30
con = New
OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=E:\Programs\MCA\Sem V\.NET\EX6\ex6.accdb")
con.Open()
cmd = New OleDb.OleDbCommand(" select * from tbl_ex6 where
fld_eid = " & Val(TextBox1.Text) & "", con)
d = cmd.ExecuteReader
While d.Read
TextBox1.Text = d(0)
TextBox2.Text = d(1)
TextBox3.Text = d(2)
TextBox4.Text = d(3)
TextBox5.Text = d(4)
TextBox6.Text = d(5)
TextBox7.Text = d(6)
TextBox8.Text = d(7)
TextBox9.Text = d(8)
TextBox10.Text = d(9)
End While
Catch ex As Exception
End Try
d.Close()
con.Close()
End Sub
End Class
Structure EMP
Public eid As Integer
Public ename As String
Public department As String
Public basicpay, hra, da, pf, tax, grosspay, netpay As Long
End Structure
31
Output:-
Result:-
Thus the Program for creating and open Database has been executed
successfully.
32
Ex.No:7
Create, Read, Update and Delete a Database using Ado.NET
AIM:-
To write a program for Create, Read, Update and Delete a Database
using Ado.NET
PROCEDURE:-
STEP1 : Start the Project
STEP2 : Open Microsoft Visual Studio 2010 ->File ->New -> Windows
Application and click ok
STEP3 : Open form1 and place the Text Box and labels and Buttons
STEP4 : To Connect the ADO.NET Connection in Button
STEP5 : To Create a Database in MS Access
STEP6 : Save the Application and Run the Application
STEP7 : Stop the Project.
Source Code:-
Imports System.Data.OleDb
Public Class Form1
Dim con As New OleDbConnection
Dim cmd As New OleDbCommand
Dim d As OleDbDataReader
Dim str As String
Dim n, i, a, x As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
str = "insert into tbl_ex7 values(" & TextBox1.Text & ",'" &
TextBox2.Text & "','" & ComboBox1.Text & "'," & TextBox3.Text & "," &
TextBox4.Text & "," & TextBox5.Text & "," & TextBox6.Text & "," &
TextBox7.Text & ",'" & TextBox8.Text & "')"
cmd = New OleDbCommand(str, con)
i = cmd.ExecuteNonQuery
MsgBox("inserted successfully")
Catch ex As Exception
End Try
33
str = "select * from tbl_ex7"
Dim adapt As New OleDbDataAdapter(str, con)
Dim ds As New DataSet
adapt.Fill(ds, "tbl_ex7")
DataGridView1.DataSource = ds.Tables(0)
End Sub
Private Sub TextBox5_LostFocus(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TextBox5.LostFocus
TextBox6.Text = Val(TextBox3.Text) + Val(TextBox4.Text) +
Val(TextBox5.Text)
TextBox7.Text = Val(TextBox6.Text) / 3
If Val(TextBox3.Text) >= 40 And Val(TextBox4.Text) >= 40 And
Val(TextBox5.Text) >= 40 Then
TextBox8.Text = "Pass"
Else
TextBox8.Text = "Re-Appear"
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
str = "update tbl_ex7 set frollno=" & TextBox1.Text & ",fname='" &
TextBox2.Text & "',fcourse='" & ComboBox1.Text & "',fm1=" &
TextBox3.Text & ",fm2=" & TextBox4.Text & ",fm3=" & TextBox5.Text &
",ftot=" & TextBox6.Text & ",favg=" & TextBox7.Text & ",fres='" &
TextBox8.Text & "' where frollno=" & TextBox1.Text & ""
cmd = New OleDbCommand(str, con)
i = cmd.ExecuteNonQuery
MsgBox("Updated Successfully ...")
str = "select * from tbl_ex7"
Dim adapt As New OleDbDataAdapter(str, con)
Dim ds As New DataSet
adapt.Fill(ds, "tbl_ex7")
DataGridView1.DataSource = ds.Tables(0)
End Sub
34
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
str = "delete * from tbl_ex7 where frollno=" & TextBox1.Text
cmd = New OleDbCommand(str, con)
i = cmd.ExecuteNonQuery
MsgBox("Deleted Successfully ...")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'Db_7DataSet.tbl_ex7' table.
You can move, or remove it, as needed.
Me.Tbl_ex7TableAdapter.Fill(Me.Db_7DataSet.tbl_ex7)
con = New
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=E:\Programs\MCA\Sem V\.NET\RecEx7\db_7.accdb")
con.Open()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox8.Text = ""
ComboBox1.Text = ""
End Sub
End Class
35
Output:-
Result:-
Thus the Program for Create, Read, Update and Delete a Database
has been executed successfully
36
ASP.NET
Ex.No:1
Create a Master Page to serve as a Template For the webpage
Aim:-
To write a program for master page using ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : To design the webpage using image, content place holder, Menu
bar
Step4 : Add give navigate URL link to one page to another page
Step5 : Save and Run the Application
Step6 : Stop the Project
Form Design:-
37
SOURCE CODE:-
Webform1.aspx
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="WebForm1.aspx.vb" Inherits="home.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
text-decoration:underline;
font-size:medium;
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
38
{
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body bgcolor="white" background="Site.Master" alink="Black">
<form id="form1" runat="server">
<div align="center" class="b">
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">COMPUTER </a></span> &nbs
p;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">SUPPORTIVE </a></span> &n
bsp;
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">COMMON </a></span>
<span class="style6">
<p class="style2">A Digital library is a library in which collections are stored
in digital formats (as opposed to print, microformor other media) and accessible
by computers. The content may be stored locally, or accessed remotely. The
first published use of the term mqy have been in a 1988 report to the
Corporation for National Research Initiative. The term was first popularized by
the NSF/DARPA/NASA Digital Libraries Initiative in 1994.Bush(1945)created
a vision based on experience("Digital Library.")</p>
</span>
</div>
</form>
</body>
</html>
39
Home.aspx
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="com.aspx.vb" Inherits="home.com" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
text-decoration:underline;
font-size:medium;
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
{
40
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">COMPUTER </a></span> &nbs
p;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">SUPPORTIVE </a></span> &n
bsp;
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">COMMON </a></span>
<span class="style6">
</span>
<center><table border="3" align="center">
<tr>
<td>DETAILS</td>
</tr><br/>
<tr>
<td>BOOK NAME</td>
</tr><br/>
<tr>
<td>MBA</td>
</tr><br/>
<tr>
<td>AUTHOR:SUBRAMANIYAM</td>
</tr><br/>
41
<tr>
<td>EDITION:5 ed</td>
</tr><br/>
<tr>
<td>PUBLICATION:MURUGAN PUBLICATION</td>
</tr><br/>
</table></center>
</div>
</form>
</body>
</html>
Sup.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="sup.aspx.vb" Inherits="home.sup" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
text-decoration:underline;
font-size:medium;
42
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
{
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">COMPUTER </a></span> &nbs
p;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">SUPPORTIVE </a></span> &n
bsp;
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">COMMON </a></span>
<span class="style6">
</span>
<center><table border="3" align="center">
<tr>
43
<td>DETAILS</td>
</tr><br/>
<tr>
<td>BOOK NAME</td>
</tr><br/>
<tr>
<td>SCINCE WORLD</td>
</tr><br/>
<tr>
<td>AUTHOR:KATHIRVEL MURUGAN</td>
</tr><br/>
<tr>
<td>EDITION:5 ed</td>
</tr><br/>
<tr>
<td>PUBLICATION:MURUGAVEL PUBLICATION</td>
</tr><br/>
</table></center>
</div>
</form>
</body>
</html>
OUTPUT:
44
Result:-
Thus the above program using master page has been executed
successfully
45
Ex.No:2
Create Admin page for browsing, Updating & Deleting Records
Aim:-
To write a program for Admin page using ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : To create a database and connect the database in our webpage
Step4 : Adding controls in a Webpage
Step5 : Choose the appropriate database data store and connect
Step6 : Save and Run the Application
Step7 : Stop the Project
FORM DESIGN:
46
SOURCE CODE:
Admin.aspx
Imports System.Data.OleDb
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub NEWUSER_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles NEWUSER.Click
Response.Redirect("Default2.aspx")
End Sub
Protected Sub LOGIN_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles LOGIN.Click
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\.net labprogram\user.mdb")
cn.Open()
cmd = New OleDbCommand("select Count(username) from Table1 where
username='" + TextBox1.Text + "' and password='" + TextBox2.Text + "'", cn)
Dim i As Integer = cmd.ExecuteScalar()
If (i > 0) Then
Response.Redirect("Default3.aspx")
Else
Label4.Visible = True
Label4.Text = " Password Incorrect "
End If
End Sub
Protected Sub CANCEL_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CANCEL.Click
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Label4.Visible = False
End Sub
47
End Class
Default2.aspx
Imports System.Data.OleDb
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub OK_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles OK.Click
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim str As String
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\.net labprogram\user.mdb")
cn.Open()
str = "insert into Table1 values('" + TextBox1.Text + "','" + TextBox2.Text +
"','" + TextBox3.Text + "')"
cmd = New OleDbCommand(str, cn)
cmd.ExecuteNonQuery()
cn.Close()
Response.Redirect("Default3.aspx")
End Sub
Protected Sub CANCEL_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CANCEL.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
End Class
Default3.aspx
Imports System.Data.OleDb
Partial Class Default3
Inherits System.Web.UI.Page
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim str As String
48
Public ha As OleDbDataAdapter
Public hc As OleDbCommandBuilder
Dim I As Integer
Dim ds As New Data.DataSet
Protected Sub INSERT_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles INSERT.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
End Sub
Protected Sub SAVE_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles SAVE.Click
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\.net labprogram2\eb.mdb")
cn.Open()
str = "insert into Table1 values('" + TextBox1.Text + "','" + TextBox2.Text +
"','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" +
TextBox6.Text + "','" + TextBox7.Text + "')"
cmd = New OleDbCommand(str, cn)
cmd.ExecuteNonQuery()
MsgBox("success")
End Sub
Protected Sub DELETE_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DELETE.Click
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\.net labprogram2\eb.mdb")
cn.Open()
str = "delete * from Table1 where(cno='" + TextBox1.Text + "')"
cmd = New OleDbCommand(str, cn)
cmd.ExecuteNonQuery()
cn.Close()
49
MsgBox("Records Successfuly Deleted")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\.net labprogram2\eb.mdb")
cn.Open()
End Sub
Protected Sub UPDATE_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles UPDATE.Click
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=E:\.net labprogram2\eb.mdb")
cn.Open()
str = "update Table1 set cname='" + TextBox2.Text.Trim() + "' where cno='" +
TextBox1.Text.Trim() + "'"
cmd = New OleDbCommand(str, cn)
cmd.ExecuteNonQuery()
MsgBox("Records Successfuly Updated")
cn.Close()
End Sub
Protected Sub DISPLAY_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DISPLAY.Click
Dim s As String
s = InputBox("Enter the rollno for display")
str = "Select * from Table1 where cno='" + s.ToString() + "'"
ha = New OleDbDataAdapter(str, cn)
hc = New OleDbCommandBuilder(ha)
ha.Fill(ds)
If ds.Tables(0).Rows.Count > 0 Then
TextBox1.Text = ds.Tables(0).Rows(0).Item("cno").ToString()
TextBox2.Text = ds.Tables(0).Rows(0).Item("cname").ToString()
TextBox3.Text = ds.Tables(0).Rows(0).Item("cadd").ToString()
TextBox4.Text = ds.Tables(0).Rows(0).Item("lastreading").ToString()
TextBox5.Text = ds.Tables(0).Rows(0).Item("currentreading").ToString()
TextBox6.Text = ds.Tables(0).Rows(0).Item("unit read").ToString()
50
TextBox7.Text = ds.Tables(0).Rows(0).Item("total").ToString()
End If
cn.Close()
End Sub
Protected Sub CALCULATE_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles CALCULATE.Click
TextBox6.Text = Val(TextBox5.Text) - Val(TextBox4.Text)
If (TextBox6.Text) >= 100 Then
TextBox7.Text = Val(TextBox6.Text) * 1.5
ElseIf (TextBox6.Text) >= 200 Then
TextBox7.Text = Val(TextBox6.Text) * 2.5
ElseIf (TextBox6.Text) >= 300 Then
TextBox7.Text = Val(TextBox6.Text) * 3.5
ElseIf (TextBox6.Text) >= 400 Then
TextBox7.Text = Val(TextBox6.Text) * 4.5
Else
TextBox7.Text = Val(TextBox6.Text) * 6
End If
End Sub
Protected Sub Button6_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button6.Click
Response.Redirect("Default4.aspx")
End Sub
End Class
Default4.aspx
Partial Class Default4
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.Redirect("Default3.aspx")
End Sub
End Class
51
OUTPUT:
Result:-
Thus the above program using Admin page has been executed
successfully.
52
Ex.No:3
Create a Simple Website
Aim:-
To write a program for Web page using ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : Add a New item then select master page place the context place
holder and image
Step4 : To design the webpage using image, content place holder, Menu
bar
Step5 : Save and Run the Application
Step6 : Stop the Project
FORM DESIGN:
53
SOURCE CODE:
WebForm1.aspx
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="WebForm1.aspx.vb" Inherits="Web1.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="b">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
text-decoration:underline;
font-size:medium;
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
54
{
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body bgcolor="red" background="Site.Master" alink="Black">
<form id="form1" runat="server">
<div align="center" class="b">
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">BOOKS </a></span> &n
bsp;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">FRIENDS </a></span>
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">PERSONALDETAIL </a></span>&nb
sp;
</div>
</form>
</body>
</html>
Home.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="home.aspx.vb" Inherits="Web1.home" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1
55
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
text-decoration:underline;
font-size:medium;
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
{
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body bgcolor="red" background="Site.Master" alink="Black">
<form id="form2" runat="server">
<div align="center" class="b">
56
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">BOOKS </a></span> &n
bsp;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">FRIENDS </a></span>
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">PERSONALDETAIL </a></span>&nb
sp;
<table border="3" align="center">
<tr>
<td>OPERATING SYSTEM</td>
</tr><br>
<tr>
<td>SOFT COMPUTING</td>
</tr><br>
<tr>
<td>MOBILE COMPUTING</td>
</tr><br>
<tr>
<td>PROGRAMMING IN C#</td>
</tr><br>
<tr>
<td>PROGRAMMING IN VB.NET</td>
</tr><br>
<tr>
<td>SOFTWARE PROJECT MANAGEMENT</td>
</tr><br>
</table>
</div>
</form>
</body>
57
</html>
Com.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="com.aspx.vb" Inherits="Web1.com" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
text-decoration:underline;
font-size:medium;
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
58
{
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body bgcolor="pink" background="Site.Master" alink="Black">
<form id="form1" runat="server">
<div align="center" class="b">
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">BOOKS </a></span> &n
bsp;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">FRIENDS </a></span>
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">PERSONALDETAIL </a></span>&nb
sp;
<table border="3" align="center">
<tr>
<td>FRIEND NAME</td>
</tr><br>
<tr>
<td>K.KAMATCHI</td>
</tr><br>
<tr>
<td>R.GAYATHRI</td>
</tr><br>
<tr>
<td>K.SUDHA</td>
</tr><br>
<tr>
59
<td>X.EXALIN MARY</td>
</tr><br>
<tr>
<td>P.PUNITHA</td>
</tr><br>
<tr>
<td>R.MEENA</td>
</tr><br>
</table>
</div>
</form>
</body>
</html>
Sup.aspx
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="sup.aspx.vb" Inherits="Web1.sup" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1
{
font-size:x-large;
font-weight:bold;
}
.style2
{
font-family:Arial,Helvetica,sans-serif;
font-weight:bold;
}
.style4
{
60
text-decoration:underline;
font-size:medium;
}
.style3
{
font-family:Arial,Helvetica,sans-serif;
}
.style5
{
font-size:medium;
}
.style6
{
font-weight:bold;
font-size:medium;
}
</style>
</head>
<body bgcolor="red" background="Site.Master" alink="Black">
<form id="form1" runat="server">
<div align="center" class="b">
<span class="style1"><a href="WebForm1.aspx" style="text-
decoration:none">HOME </a></span> &nb
sp;
<span class="style1"><a href="home.aspx" style="text-
decoration:none">BOOKS </a></span> &n
bsp;
<span class="style1"><a href="com.aspx" style="text-
decoration:none">FRIENDS </a></span>
<span class="style1"><a href="sup.aspx" style="text-
decoration:none">PERSONALDETAIL </a></span>&nb
sp;
<table border="3" align="center">
<tr>
61
<td>NAME:C.CAROLIN RITA MARY</td>.
</tr><br>
<tr>
<td>FATHER NAME:C.CHRISTHU RAJ</td>
</tr><br>
<tr>
<td>MOTHER NAME:S.ANGALIN MARY</td>
</tr><br>
<tr>
<td>HOBBIES:READING BOOKS<br />LISENING MUSIC</td>
</tr><br>
<tr>
<td>I AM STUDING IN MCA</td>
</tr><br>
<tr>
<td>ADDRESS:3/1 NARANAMPALAYAM<br
/>KAMALAPURAM(P.O)<br />OMALUR(T.K)<br />SALEM(D.T)</td>
</tr><br>
<tr>
<td>PHONE NUMBER:9443194446<br />9442614446</td>
</tr><br>
<tr>
<td>EMAIL ID:[email protected]</td>
</tr><br>
</table>
</div>
</form>
</body>
</html>
62
OUTPUT:
Result:-
Thus the above program for simple web page has been executed
successfully.
63
Ex.No:4
Creating and open connection in database using ADO>.NET
Aim:-
To write a program for create and open database using ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : To create a database and connect the database in our webpage
Step4 : Adding controls in a webpage such as object source
Step5 : Choose the appropriate database data store and connected the
Control
Step6 : Save and Run the Application
Step7 : Stop the Project
FORM DESIGN:
SOURCE CODE:
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim str As String
Dim dr As OleDbDataReader
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button1.Click
64
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
con.Open()
str = "insert into Table1 values('" & TextBox1.Text & "','" & TextBox2.Text &
"','" & TextBox3.Text & "','" & TextBox4.Text & "')"
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
con.Close()
MsgBox("Stored Success")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button3.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
con.Open()
cmd = New OleDbCommand("select * from Table1", con)
Dim adapt As New OleDbDataAdapter(str, con)
Dim ds As New DataSet
GridView1.Visible = True
GridView1.DataBind()
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button4.Click
Dim i As Integer
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
con.Open()
65
str = "delete * from Table1 where regno=" & Val(InputBox("Enter the
Regno:"))
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
MsgBox("Delete Success")
End Sub
End Class
OUTPUT:
Result:-
Thus the above program Create and Open Database using ASP.NET
has been executed successfully.
66
Ex.No:5
Create, Read, Update, Delete Records in Database using ADO.NET
Aim:-
To write a program for Create, Read, Update, Delete Records in
Database
Using ADO.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : To create a database and connect the database in our webpage
Step4 : Adding controls in a webpage such as object source
Step5 : Choose the appropriate database data store and connected the
Control
Step6 : Save and Run the Application
Step7 : Stop the Project
FORM DESIGN:
SOURCE CODE:
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim str As String
67
Dim dr As OleDbDataReader
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button1.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
con.Open()
str = "insert into Table1 values('" & TextBox1.Text & "','" & TextBox2.Text &
"','" & TextBox3.Text & "','" & TextBox4.Text & "')"
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
con.Close()
MsgBox("Stored Success")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button3.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
con.Open()
cmd = New OleDbCommand("select * from Table1", con)
Dim adapt As New OleDbDataAdapter(str, con)
Dim ds As New DataSet
GridView1.Visible = True
GridView1.DataBind()
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button4.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
68
con.Open()
str = "delete * from Table1 where regno=" & Val(InputBox("Enter the
Regno:"))
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
MsgBox("Delete Success")
End Sub
Protected Sub Button5_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button5.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\STU.mdb")
con.Open()
str = "update Table1 set regno=" & TextBox1.Text & ",name='" &
TextBox2.Text & "',address='" & TextBox3.Text & "',course='" &
TextBox4.Text & "' where regno=" & TextBox1.Text & ""
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
MsgBox("Update Success")
End Sub
End Class
OUTPUT:
69
Result:-
Thus the above program Create, Read, Update, Delete Records in
Database
Using ADO.NET has been executed successfully.
70
Ex.No:6
SQL Database for Populate a Drop Down list and Grid View
Aim:-
To write a program for SQL Database for Populate a Drop Down list and
Grid View Using ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : To create a database and connect the database in our webpage
Step4 : Adding controls in a webpage
Step5 : Choose the appropriate database data store and connected the
Control
Step6 : Save and Run the Application
Step7 : Stop the Project
FORM DESIGN:
SOURCE CODE:
Imports System.Data.SqlClient
Imports System.Data
Public Class WebForm1
Inherits System.Web.UI.Page
Dim con As New System.Data.SqlClient.SqlConnection
Dim cmd As New System.Data.SqlClient.SqlCommand
Dim adp As New System.Data.SqlClient.SqlDataAdapter
71
Dim ds As New DataSet()
Dim tbl As New Table
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button1.Click
con.ConnectionString = ("Data
Source=carolin;AttachDbFilename=C:\Users\HP
246\Documents\STU.mdb;Integrated Security=True")
con.Open()
adp = New SqlDataAdapter("select * from Table1 where name='" +
DropDownList1.Text + "'", con)
adp.Fill(ds, "Table1")
GridView1.DataSource = ds.Tables("Table")
GridView1.DataBind()
con.Close()
End Sub
End Class
OUTPUT:
Result:-
Thus the above program SQL Database for Populate a Drop Down list
and Grid View Using ASP.NET has been executed successfully.
72
Ex.No:7
Object Data store to populate a Grid View
Aim:-
To write a program for Object Data Store to Populate Grid View in
ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –> Web
application ->Ok
Step3 : To create a database and connect the database in our webpage
Step4 : Adding the controls in a webpage
Step5 : Choose the appropriate database data store and connected the
Control
Step6 : Save and Run the Application
Step7 : Stop the Project
FORM DESIGN:
SOURCE CODE:
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
Dim con As OleDbConnection
Dim cmd As OleDbCommand
Dim str As String
73
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button1.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\APP.mdb")
con.Open()
str = "insert into Table1 values('" & TextBox1.Text & "','" & TextBox2.Text &
"','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','"
& TextBox6.Text & "','" & TextBox7.Text & "')"
cmd = New OleDbCommand(str, con)
cmd.ExecuteNonQuery()
con.Close()
MsgBox("Stored Success")
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button3.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox5.Text = ""
TextBox4.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs)
Handles Button2.Click
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Users\HP 246\Documents\APP.mdb")
con.Open()
cmd = New OleDbCommand("select * from Table1", con)
Dim adp As New OleDbDataAdapter(str, con)
Dim ds As New DataSet
GridView1.Visible = True
74
GridView1.DataBind()
End Sub
End Class
OUTPUT:
Result:-
Thus the above program Data Store to Populate Grid View in
ASP.NET has been executed successfully.
75
Ex.No:8
FEEDBACK FORM
Aim:-
To write a program for Feedback Form in ASP.NET
Procedure:-
Step1 : Start the project
Step2 : Open the Microsoft Visual Studio 2010 ->File -> new –>
Web application ->Ok
Step3 : To create a database and connect the database in our webpage
Step4 : Adding the controls in a webpage
Step5 : Choose the appropriate database data store and connected the
Control
Step6 : Save and Run the Application
Step7 : Stop the Project
Default.aspx:
<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="javascript" >
function ValidateComments(sender,args)
{
if(args.Value.Length > 10)
args.IsValid=false;
else
args.IsValid=true;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
76
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-
Size="XX-Large" ForeColor="Maroon"
Text="FEED BACK FORM" Width="304px"></asp:Label>
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="3"
BackColor="#FFFBD6" BorderColor="#FFDFAD"
BorderWidth="1px" Font-Names="Verdana" Font-Size="XX-Large"
Height="336px" Style="position: static"
Width="704px" Font-Bold="True" ForeColor="#0000C0">
<StepStyle VerticalAlign="Top" />
<SideBarStyle BackColor="#990000" Font-Size="0.9em"
VerticalAlign="Top" Width="100px" />
<NavigationButtonStyle BackColor="White" BorderColor="#CC9966"
BorderStyle="Solid"
BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em"
ForeColor="#990000" />
<WizardSteps>
<asp:WizardStep runat="server" Title="Contact Info">
<table cellpadding="10">
<tr>
<td style="width: 100px">
Your Name</td>
<td style="width: 100px">
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server" ControlToValidate="txtName"
ErrorMessage="Please entere the
name">*</asp:RequiredFieldValidator>
77
</td>
</tr>
<tr>
<td style="width: 100px">
Email</td>
<td style="width: 100px">
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
</td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID = "Required Field Validator 2" runat =
"server" ControlToValidate="txtEmail"
ErrorMessage="You must enter the vaild email
address">*</asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ControlToValidate="txtEmail"
ErrorMessage="Enter valid Email address([email protected])"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-
.]\w+)*">*</asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td colspan="2">
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
Width="216px" />
</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Comments">
<table>
<tr>
<td style="width: 100px; height: 50px">
Comments(not more than 10 char)</td>
78
<td style="width: 100px; height: 50px">
<asp:TextBox ID="txtComments" runat="server"
TextMode="MultiLine"></asp:TextBox>
</td>
<td style="width: 100px; height: 50px">
<asp:CustomValidator ID="CustomValidator1" runat="server"
ClientValidationFunction="ValidateComments"
ControlToValidate="txtComments" ErrorMessage="Not more than 10
Charaters please">*</asp:CustomValidator>
</td>
</tr>
<tr>
<td style="width: 100px">
Rating( 1-5)</td>
<td style="width: 100px">
<asp:TextBox ID="txtRating" runat="server"></asp:TextBox>
</td>
<td style="width: 100px">
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtRating"
ErrorMessage="Use the rating between 1to 5" MaximumValue="5"
MinimumValue="1">*</asp:RangeValidator>
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td colspan="2">
<asp:ValidationSummary ID="ValidationSummary2" runat="server"
Width="208px" />
</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep runat="server" StepType="Finish" Title="Summary">
79
(Show example)</asp:WizardStep>
<asp:WizardStep runat="server" StepType="Complete"
Title="Complete">
</asp:WizardStep>
</WizardSteps>
<SideBarButtonStyle ForeColor="White" />
<HeaderStyle BackColor="#FFCC66" BorderColor="#FFFBD6"
BorderStyle="Solid" BorderWidth="2px"
Font-Bold="True" Font-Size="0.9em" ForeColor="#333333"
HorizontalAlign="Center" />
<SideBarTemplate>
<asp:DataList ID="SideBarList" runat="server">
<SelectedItemStyle Font-Bold="True" />
<ItemTemplate>
<asp:LinkButton ID="SideBarButton" runat="server"
ForeColor="White"></asp:LinkButton>
</ItemTemplate>
</asp:DataList>
</SideBarTemplate>
</asp:Wizard>
</div>
</form>
</body>
</html>
Default.aspx.vb:
Imports System.Net.Mail
Imports System.Web.Mail
Imports System.Text
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub CustomValidator1_ServerValidate(ByVal source As
Object, ByVal args As System.
Web.UI.WebControls.ServerValidateEventArgs) Handles Custom
Validator 1.ServerValidate
80
If txtComments.Text.Length > 10 Then
args.IsValid = False
Else
args.IsValid = True
End If
End Sub
Protected Sub Wizard1_FinishButtonClick(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs)
Handles Wizard1.FinishButtonClick
SendMail(txtEmail.Text, txtComments.Text)
MsgBox("Mail has been send successfully")
End Sub
Private Sub SendMail(ByVal from As String, ByVal body As String)
Dim mm As New System.Net.Mail.SmtpClient
mm.EnableSsl = True
mm.Host = "smtp.gmail.com"
Dim cred As New
System.Net.NetworkCredential("[email protected]","examplepassw
ord") mm.Credentials = cred
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
End Sub
End Class
81
OUTPUT
RESULT:
Thus the above program Feedback Form in ASP.NET has been
executed successfully.
82