Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

VB Program

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 57

1.

Using Namespaces

AIM:

To create a console application using name space.

ALGORITHM:

Step 1: Start the process

Step 2: Open new console application

Step 3:Create four functions for calculating arithmetic problems.

Step 4: Create a module and Declare variables a, b and set the data type as integer

Step 5: Include the function in the module and Get input from user in the sub main()
in the module1.

Step 6: Using those functions in the class, calculate the two inputs and display the
result.

Step 7: Stop the process.


Namespace arithmetic
Public Class subt
Public Function dif(ByVal a As Integer, ByVal b As Integer)
Return a - b
End Function
End Class
Public Class add
Public Function sum(ByVal a As Integer, ByVal b As Integer)
Return a + b
End Function
End Class
Public Class prod
Public Function prod(ByVal a As Integer, ByVal b As Integer)
Return a * b
End Function
End Class
Public Class divi
Public Function Quo(ByVal a As Integer, ByVal b As Integer)
Return a / b
End Function
End Class
End Namespace
Module Module1
Sub Main()
Dim res As arithmetic.add = New arithmetic.add
Dim res1 As arithmetic.divi = New arithmetic.divi
Dim res2 As arithmetic.prod = New arithmetic.prod
Dim res3 As arithmetic.subt = New arithmetic.subt
Dim a, b As Integer
Console.WriteLine("Name:MANESH.M")
Console.WriteLine("Reg No:14BCS021")
Console.WriteLine("Enter the value for a")
a = Console.ReadLine()
Console.WriteLine("Enter the value for b")
b = Console.ReadLine()
Console.WriteLine(" The difference is :" & res3.dif(a, b))
Console.WriteLine(" The product is :" & res2.prod(a, b))
Console.WriteLine(" The sum is :" & res.sum(a, b))
Console.WriteLine(" The quotient :" & res1.Quo(a, b))
Console.ReadLine()
End Sub
End Module

OUTPUT:-
2.Passing Arrays

AIM:

To create passing array using ByVal and ByRef arguments.

ALGORITHM:

Step 1: start the process

Step 2: open the console application

Step 3: declare the variables as byval array and byref array as integer

Step 4: define a procedure for getting an array a input

Step 5: redefine the size of the array using radim method

Step 6: print the size of the array in main and procedure

Step 7: execute the application

Step 8: stop the process.


Module Module1

Sub Main()
Dim vala(10) As Integer
Dim refb(10) As Integer
Call arrayvalref(vala, refb)
Console.WriteLine("display the number using byval")
Console.WriteLine(UBound(vala))
Console.WriteLine("display the number using byref")
Console.WriteLine(UBound(refb))
Console.ReadKey()

End Sub
Sub arrayvalref(ByVal arr1() As Integer, ByRef arr2() As Integer)
ReDim arr1(100)
ReDim arr2(200)
End Sub
End Module

output
3.Sum of Array Elements

AIM:

To create a function to calculate sum of array elements.

ALGORITHM:

Step 1: Start the process

Step 2: Open the console application

Step 3: Declare the variables with their datatypes.

Step 4: Write a function to calculate the sum of array elements and to get the
average.

Step 5: Declare an array with values in the main().

Step 6: Call the function in the main().

Step 7: Execute the program.

Step 8: stop the process.


Module Module1
Dim i As Integer
Dim avg As Double
Dim sum As Integer = 0
Dim array(5) As Double
Public Sub GetAverage(ByVal arr As Integer(), ByVal Size As Integer)
For i = 0 To Size - 1
sum = sum + arr(i)
Console.WriteLine(sum)
Next i
avg = sum / size
Console.WriteLine("Average value:{0}" & avg)
End Sub

Sub Main()
Console.WriteLine("Name:MANESH.M")
Console.WriteLine("Reg No:14BCS021")

Dim balance As Integer() = {10, 2, 3, 17, 55}


GetAverage(balance, 5)
Console.ReadLine()

End Sub

End Module
OUTPUT:-
4.Changing Back Color

AIM

Create a windows application using horizontal scrollbar to change the form back
color.

ALGORITHM

Step 1: Start the process

Step 2: Open a new window form application

Step 3: Design a form using horizontal scrollbar

Step 4: Set the values of horizontal scroll bar in the properties windows as
min value=0, max value=225

Step 5: use one scrollbar procedure for handling all scrollbar value to set the
background color of the form

Step 6: Run the program

Step 7: Stop the process


Public Class Form1

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


System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
Me.BackColor = Color.FromArgb(HScrollBar1.Value, HScrollBar2.Value,
HScrollBar3.Value)
Label1.Text = HScrollBar1.Value
End Sub

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


System.Windows.Forms.ScrollEventArgs) Handles HScrollBar2.Scroll
Me.BackColor = Color.FromArgb(HScrollBar1.Value, HScrollBar2.Value,
HScrollBar3.Value)
Label2.Text = HScrollBar2.Value
End Sub

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


System.Windows.Forms.ScrollEventArgs) Handles HScrollBar3.Scroll
Me.BackColor = Color.FromArgb(HScrollBar1.Value, HScrollBar2.Value,
HScrollBar3.Value)
Label3.Text = HScrollBar3.Value
End Sub

End Class

OUTPUT:-
5.Calculator

AIM

Create a windows application to create a calculator.

ALGORITHM

Step 1: Start the process

Step 2: Open a new window form application

Step 3: Design a form using 18 buttons and a textbox

Step 4: Set the values of the buttons in the properties windows as numbers from 0-9
as in a calculator and remaining buttons as +, -, *, /, dot, clear and ac.

Step 5: Code the buttons to perform various functions and display the result.

Step 6: Run the program


Step 7: Stop the process

Public Class Form1


Dim value1 As Double
Dim value2 As Double
Dim mul, div, subt, sum As Boolean

Private Sub Button1_Click_1(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 System.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

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


Handles Button5.Click
TextBox1.Text = TextBox1.Text & 4

End Sub

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


Handles Button6.Click
TextBox1.Text = TextBox1.Text & 5
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button7.Click
TextBox1.Text = TextBox1.Text & 6
End Sub

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


Handles Button9.Click
TextBox1.Text = TextBox1.Text & 7
End Sub

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


System.EventArgs) Handles Button10.Click
TextBox1.Text = TextBox1.Text & 8
End Sub

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


System.EventArgs) Handles Button11.Click
TextBox1.Text = TextBox1.Text & 9
End Sub

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


System.EventArgs) Handles Zero.Click
TextBox1.Text = TextBox1.Text & 0
End Sub

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


Handles Dot.Click
TextBox1.Text = TextBox1.Text & "."
End Sub

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


Handles Clear.Click
TextBox1.Clear()
End Sub

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


Handles Power.Click
End
End Sub

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


Handles Add.Click
value1 = TextBox1.Text
sum = True
TextBox1.Clear()
End Sub

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


System.EventArgs) Handles Subtract.Click
value1 = TextBox1.Text
subt = True
TextBox1.Clear()
End Sub
Private Sub Multiply_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Multiply.Click
value1 = TextBox1.Text
mul = True
TextBox1.Clear()
End Sub

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


Handles Divide.Click
value1 = TextBox1.Text
div = True
TextBox1.Clear()
End Sub

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


Handles Equal.Click
value2 = TextBox1.Text
If sum = True Then
TextBox1.Text = value1 + value2
sum = False
End If
If subt = True Then
TextBox1.Text = value1 - value2
subt = False
End If
If mul = True Then
TextBox1.Text = value1 * value2
mul = False
End If
If div = True Then
TextBox1.Text = value1 / value2
div = False
End If

End Sub

End Class

OUTPUT:-
6.Implementing Message Box() & InputBox()

AIM

Create a windows application to implement msgbox() and inputbox().

ALGORITHM

Step 1: Start the process

Step 2: Open a new window form application

Step 3: Design a form using a button.


Step 4: code the button to check the eligibility to vote and to implement msgbox()
and inputbox()

Step 5: Run the program

Step 6: Stop the process

Public Class Form1


Dim age As Integer

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


Handles Button1.Click
age = InputBox("Enter your age", "CMS College Of Science & Commerce,student
registration")
If (age >= 18) Then
MsgBox("You are eligible to vote.")
Else
MsgBox("You are not eligible to vote.")
End If
End Sub
End Class

OUTPUT:-
7.Notepad application

AIM:

To develop a notepad using application.

ALGORITHM:

Step 1: Start the process.


Step 2: Open a new form window form application.

Step 3: Drag the menu script control and place in the form to create menu and
sub menu.

Step 4:Add openfiledialog, savefiledialog, fontdialog, colordialog control for


open a file, saving file formatting text.

Step 5: Add Richtextbox control for typing text and formatting.

Step 6: Give necessary coding for all control.

Step 7: Run the program.

Step 8: Stop the process.

FORM1.VB:-

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 OPENToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs)
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName Then
RichTextBox1.LoadFile(OpenFileDialog1.FileName,
RichTextBoxStreamType.UnicodePlainText)
End If
End Sub
Private Sub SAVEToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
SaveFileDialog1.ShowDialog()
If OpenFileDialog1.FileName Then
RichTextBox1.SaveFile(SaveFileDialog1.FileName,
RichTextBoxStreamType.PlainText)
Else
SaveFileDialog1.ShowDialog()
End If
End Sub

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


System.EventArgs) Handles ExitToolStripMenuItem.Click
End
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

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


System.EventArgs) Handles PasteToolStripMenuItem.Click
RichTextBox1.Paste()
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 FONTToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles FontToolStripMenuItem.Click
FontDialog1.ShowDialog()
RichTextBox1.SelectionFont = FontDialog1.Font
End Sub

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


System.EventArgs) Handles ColorToolStripMenuItem.Click
ColorDialog1.ShowDialog()
RichTextBox1.ForeColor = ColorDialog1.Color
End Sub

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


System.EventArgs) Handles WordWrapToolStripMenuItem.Click
RichTextBox1.WordWrap = Not (RichTextBox1.WordWrap)
End Sub
Private Sub OPENToolStripMenuItem_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles OpenToolStripMenuItem.Click
OpenFileDialog1.ShowDialog()
If OpenFileDialog1.FileName <> "" Then
RichTextBox1.LoadFile(OpenFileDialog1.FileName,
RichTextBoxStreamType.PlainText)
End If
End Sub

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


System.EventArgs) Handles SaveToolStripMenuItem.Click
SaveFileDialog1.ShowDialog()
If OpenFileDialog1.FileName <> "" Then
RichTextBox1.SaveFile(SaveFileDialog1.FileName,
RichTextBoxStreamType.PlainText)
Else
SaveFileDialog1.ShowDialog()
End If
End Sub
End Class

Output:-
8.College website
AIM:

To develop a college website in asp.net.

ALGORITHM:

Step 1: Start the process.

Step 2: Open a new website program.

Step 3: Edit the template in default.aspx, about.aspx, site.master and site.css

Step 4:Change the header and data in the website.

Step 5: Run the program.

Step 6: Stop the process


default.aspx
<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master"
AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">


</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Welcome!
</h2>
<p>
To learn more about courses visit <a href="http://cmscbe.com/academics/courses/"
title="ASP.NET Website">www.cmscbe.com/academics/courses/</a>.
</p>
<p>
You can also find more on <a href="http://cmscbe.com/"
title="MSDN ASP.NET Docs">www.cmscbe.com</a>.
</p>
</asp:Content>

about.aspx
<%@ Page Title="About Us" Language="VB" MasterPageFile="~/Site.Master"
AutoEventWireup="false"
CodeFile="About.aspx.vb" Inherits="About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">


</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
About
</h2>
<p>
Put content here.
</p>
</asp:Content>

site.master
<%@ Master Language="VB" AutoEventWireup="false" CodeFile="Site.Master.vb"
Inherits="Site" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1>
CMS COLLEGE OF SCIENCE & COMMERCE
</h1>
</div>

<div class="clear hideSkiplink">


<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu"
EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About"/>
</Items>
</asp:Menu>
</div>
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear">
</div>
</div>
<div class="footer">

</div>
</form>
</body>
</html>

Site.css

/* DEFAULTS
----------------------------------------------------------*/

body
{
background: #b6b7bc;
font-size: .80em;
font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica,
Verdana, sans-serif;
margin: 0px;
padding: 0px;
color: #696969;
}

a:link, a:visited
{
color: #034af3;
}

a:hover
{
color: #1d60ff;
text-decoration: none;
}

a:active
{
color: #034af3;
}
p
{
margin-bottom: 10px;
line-height: 1.6em;
}

/* HEADINGS
----------------------------------------------------------*/

h1, h2, h3, h4, h5, h6


{
font-size: 1.5em;
color: #666666;
font-variant: small-caps;
text-transform: none;
font-weight: 200;
margin-bottom: 0px;
}

h1
{
font-size: 1.6em;
padding-bottom: 0px;
margin-bottom: 0px;
}

h2
{
font-size: 1.5em;
font-weight: 600;
}

h3
{
font-size: 1.2em;
}

h4
{
font-size: 1.1em;
}

h5, h6
{
font-size: 1em;
}

/* this rule styles <h1> and <h2> tags that are the
first child of the left and right table columns */
.rightColumn > h1, .rightColumn > h2, .leftColumn > h1, .leftColumn > h2
{
margin-top: 0px;
}

/* PRIMARY LAYOUT ELEMENTS


----------------------------------------------------------*/

.page
{
width: 960px;
background-color: #fff;
margin: 20px auto 0px auto;
border: 1px solid #496077;
}

.header
{
position: relative;
margin: 0px;
padding: 0px;
background: #4b6c9e;
width: 100%;
}

.header h1
{
font-weight: 700;
margin: 0px;
padding: 0px 0px 0px 20px;
color: #f9f9f9;
border: none;
line-height: 2em;
font-size: 2em;
}

.main
{
padding: 0px 12px;
margin: 12px 8px 8px 8px;
min-height: 420px;
}

.leftCol
{
padding: 6px 0px;
margin: 12px 8px 8px 8px;
width: 200px;
min-height: 200px;
}

.footer
{
color: #4e5766;
padding: 8px 0px 0px 0px;
margin: 0px auto;
text-align: center;
line-height: normal;
}

/* TAB MENU
----------------------------------------------------------*/
div.hideSkiplink
{
background-color:#3a4f63;
width:100%;
}

div.menu
{
padding: 4px 0px 4px 8px;
}

div.menu ul
{
list-style: none;
margin: 0px;
padding: 0px;
width: auto;
}

div.menu ul li a, div.menu ul li a:visited


{
background-color: #465c71;
border: 1px #4e667d solid;
color: #dde4ec;
display: block;
line-height: 1.35em;
padding: 4px 20px;
text-decoration: none;
white-space: nowrap;
}

div.menu ul li a:hover
{
background-color: #bfcbd6;
color: #465c71;
text-decoration: none;
}

div.menu ul li a:active
{
background-color: #465c71;
color: #cfdbe6;
text-decoration: none;
}

/* FORM ELEMENTS
----------------------------------------------------------*/

fieldset
{
margin: 1em 0px;
padding: 1em;
border: 1px solid #ccc;
}

fieldset p
{
margin: 2px 12px 10px 10px;
}

fieldset.login label, fieldset.register label, fieldset.changePassword label


{
display: block;
}

fieldset label.inline
{
display: inline;
}

legend
{
font-size: 1.1em;
font-weight: 600;
padding: 2px 4px 8px 4px;
}

input.textEntry
{
width: 320px;
border: 1px solid #ccc;
}

input.passwordEntry
{
width: 320px;
border: 1px solid #ccc;
}

div.accountInfo
{
width: 42%;
}

/* MISC
----------------------------------------------------------*/

.clear
{
clear: both;
}

.title
{
display: block;
float: left;
text-align: left;
width: auto;
}

.loginDisplay
{
font-size: 1.1em;
display: block;
text-align: right;
padding: 10px;
color: White;
}

.loginDisplay a:link
{
color: white;
}

.loginDisplay a:visited
{
color: white;
}

.loginDisplay a:hover
{
color: white;
}

.failureNotification
{
font-size: 1.2em;
color: Red;
}

.bold
{
font-weight: bold;
}

.submitButton
{
text-align: right;
padding-right: 10px;
}
OUTPUT:-
9.Number of hits

AIM:

Write a program to find the number of hits


in a web site.

ALGORITHM:

Step1: Start the Process.

Step2: Open web site from visual studio with language vb.

Step3: Design the web page using two Labels and some content.

Step4: Use Global.aspx for saving the hits of web page.

Step5: Run and Display the Webpage using a web browser.

Step6: Stop the process.


DEFAULT.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"


Inherits="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 id="Head1" runat="server">
<title></title>
<style type="text/css">
.style1
{
font-size: x-large;
}
</style>
</head>
<body style="font-weight: 700">
<form id="form1" runat="server">
<div style="font-weight: 700; font-style: italic">

<span class="style1">WELCOME TO MY PAGE</span><br />


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</div>
<p>
your visitor
number:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
<p>
</p>
<p>
&nbsp;</p>
<p>
&nbsp;</p>
</form>
</body>
</html>

GLOBAL.ASAX

<%@ Application Language="VB" %>


<script runat="server">

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)


' Code that runs on application startup
Application("visit") = 0
End Sub

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)


' Code that runs on application shutdown
End Sub

Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)


' Code that runs when an unhandled error occurs
End Sub

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)


' Code that runs when a new session is started
Application("visit") = Int(Application("visit") + 1)
End Sub

Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)


' Code that runs when a session ends.
' Note: The Session_End event is raised only when the sessionstate mode
' is set to InProc in the Web.config file. If session mode is set to StateServer
' or SQLServer, the event is not raised.
End Sub
</script>

DEFAULT.ASPX.VB
Partial Class webform1
Inherits System.Web.UI.Page

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


Me.Load
Label1.Text = Application("visit").ToString()
End Sub
End Class
10.TREE VIEW CREATION

AIM:

To create a program to design a Web page using Tree view control which
displays college course details.

ALGORITHM:

Step1 :Start the process.

Step 2 :Design the form using Label and “Tree view” control for college course
Details .

Step 3:Create Nodes & Sub nodes using node option in properties for UG courses
and PG course.

Step 4:Create new web pages for each sub nodes.

Step 5:Give Link for each web page in Tree view Node Editor using “Navigate Url”
property.

Step 6:Save and execute the program in the browser.

Step 7:Stop the process


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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="Courses" Value="Courses">
<asp:TreeNode Text="UG" Value="UG" NavigateUrl="Defaultug.aspx">
</asp:TreeNode>
<asp:TreeNode Text="PG" Value="PG" NavigateUrl="Defaultpg.aspx">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Admissions" Value="Admissions"
NavigateUrl="Default2.aspx"></asp:TreeNode>
<asp:TreeNode Text="Contact Us" Value="Contact Us"
NavigateUrl="http://cmscbe.com/contact/"></asp:TreeNode>
</Nodes>
</asp:TreeView>
</form>
</body>
</html>

DEFAULT2.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb"


Inherits="Default2" %>

<!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>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:TreeView ID="TreeView1" runat="server">


<Nodes>
<asp:TreeNode NavigateUrl="http://cmscbe.com/admission/"
Text="Admissions"
Value="Admissions">
<asp:TreeNode NavigateUrl="http://cmscbe.com/academics/courses/"
Text="UG"
Value="UG"></asp:TreeNode>
<asp:TreeNode Text="PG" Value="PG"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</div>
</form>
</body>
</html>

DEFAULTUG.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Defaultug.aspx.vb"


Inherits="Defaultug" %>

<!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>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:TreeView ID="TreeView1" runat="server">


<Nodes>
<asp:TreeNode Text="UG" Value="UG">
<asp:TreeNode NavigateUrl="http://cmscbe.com/departments/computer-
science/"
Text="BSC CS" Value="BSC CS"></asp:TreeNode>
<asp:TreeNode NavigateUrl="http://cmscbe.com/departments/information-
technology/"
Text="BSC IT" Value="BSC IT"></asp:TreeNode>
<asp:TreeNode NavigateUrl="http://cmscbe.com/departments/computer-
applications/"
Text="BCA" Value="BSC CT"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>
</div>
</form>
</body>
</html>
DEFAULTPG.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Defaultug.aspx.vb"


Inherits="Defaultug" %>

<!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 id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<a href="http://cmscbe.com/departments/computer-science/" title="bsccs">MSC


CS</a><br />
<a href="http://cmscbe.com/departments/information-technology/" title="bscit">MSC
IT</a><br />
<a href="http://cmscbe.com/departments/computer-applications/"
title="bca">MCA</a></div>
</form>
</body>
</html>
11.SITEMAP CREATION

AIM:

To create a program for SiteMapPath for any organization Form using all the
validation controls.

ALGORITHM:

Step 1: Start the process

Step 2: Open Visual studio and Create a new web application.

Step 3: Design the webpage for organization using three LinkButton for
services, consultancy and contact details.

Step 4: Create web forms for home page, service page, consultant page, and
contact page and about us page. Link all the pages using the linkbutton created in
which page.

Step 5: Right Click on the application and add New Item sitemap in the
application which is an xml file and write the code for sitemap root nodes and child
nodes for all the web forms.

Step 6: Add a sitemap from navigation control from toolbox in each web
form. And sitmap path will be display in each page as per the code of XML file.
Home>services.

Step 7: Save and execute the program.

Step 8: Stop the process.


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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Welcome To The HomePage<br />
<asp:LinkButton ID="LinkButton1" runat="server">Services</asp:LinkButton>
<br />
<asp:LinkButton ID="LinkButton2" runat="server">Consultancy</asp:LinkButton>
<br />
<asp:LinkButton ID="LinkButton3" runat="server">Contact Us</asp:LinkButton>

</div>
</form>
</body>
</html>

DEFAULT.ASPX.VB

Partial Class _Default


Inherits System.Web.UI.Page

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


Handles LinkButton2.Click
Response.Redirect("consultancy.aspx")
End Sub

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


Handles LinkButton1.Click
Response.Redirect("services.aspx")
End Sub

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


Handles LinkButton3.Click
Response.Redirect("contact.aspx")
End Sub
End Class
SERVICES.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="services.aspx.vb"


Inherits="services" %>
<!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 id="Head1" runat="server">
<title></title>
</head>
<body style="font-size: x-large">
<form id="form1" runat="server">
<div style="text-align: center">
welcome To The services Page<br />
</div>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:SiteMapPath ID="SiteMapPath1" runat="server"
style="top: 55px; left: 95px; position: absolute; height: 27px; width:
156px">
</asp:SiteMapPath>
</p>
<p>
<asp:LinkButton ID="LinkButton1" runat="server" style="font-size:
medium">CONSULTING</asp:LinkButton>
</p>
<p>
<asp:LinkButton ID="LinkButton2" runat="server" style="font-size:
medium">CONTACT</asp:LinkButton>
</p>
</form>
</body>
</html>

SERVICES.ASPX.VB

Partial Class services


Inherits System.Web.UI.Page

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


Handles LinkButton1.Click
Response.Redirect("consultancy.aspx")
End Sub

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


Handles LinkButton2.Click
Response.Redirect("contact.aspx")
End Sub
End Class
CONSULTANCY.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="consultancy.aspx.vb"


Inherits="consultancy" %>

<!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 id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: center; font-size: x-large">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;
Welcome to the consulting page<br />

</div>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:SiteMapPath ID="SiteMapPath1" runat="server"
style="top: 55px; left: 95px; position: absolute; height: 27px; width:
156px">
</asp:SiteMapPath>
</p>
</form>
</body>
</html>

CONTACT.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="consultancy.aspx.vb"


Inherits="consultancy" %>

<!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 id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: center; font-size: x-large">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;
Welcome to the contact page<br />
</div>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:SiteMapPath ID="SiteMapPath1" runat="server"
style="top: 55px; left: 95px; position: absolute; height: 27px; width:
156px">
</asp:SiteMapPath></p></form></body></html>
WEB.SITEMAP

<?xml version="1.0" encoding="utf-8" ?>


<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="default.aspx" title="home" description="homepage">
<siteMapNode url="services.aspx" title="services" description="servicespage" >
<siteMapNode url="consultancy.aspx" title="consulting"
description="consultingpage"/>
<siteMapNode url="contact.aspx" title="contact" description="contactpage"/>
</siteMapNode>
</siteMapNode>
</siteMap>
12.IMPLEMENTING VALIDATION CONTROL

AIM:

To create a program to design a Web Registration Form using all the validation
controls.

ALGORITHM:

Step 1: Start Microsoft Visual Studio 2005.

Step 2: Create new ASP.NET website.

Step 3: Design a registration form with text boxes and label control to get the
information’s such as User Name, Age, Email id, Password, Confirm Password and
submit button.

Step 4: Add required flied validator to name text box and set the following
properties such as error message, text, control to validator with relevant information.

Step 5: Add range validator to age text box and set the following properties
such as error message ,text, maximum value, minimum value ,control to validate with
relevant information.

Step 6: Add regular expression validator to E Mail id text box and set the
following properties such as error message, text, validation expression, control to
validate with relevant information.

Step 7: Add required flied validator to password text box and set the following
properties such as error message, text, and control to validate with relevant
information.

Step 8: Add compare validator to confirm password text box and set the
following properties such as error message, text, control to compare, control to
validate with relevant information.

Step 9: Add Validation Summary Control to display all the Error Message. By
setting validation group property as “*” and text property also as “* “ for which
validation control including the submit button.
Step10: Go to solution explorer and right click website add new item
(Default2.aspx) rename the page as welcome.aspx.

Step11: write the code in submit button for checking if page is valid or not. If
All the fields are validated the redirect to the welcome.aspx page.

Step12: In welcome.aspx page design the page with message “ Thank you for
registering”

Step13: Right click Default.aspx and give set as start page.

Step14: start debugging through F5 function key.

Step15: Stop the process.

DEFAULT.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Reg"


%>

<!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 id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<p style="text-align: center">
VALIDATION&nbsp; FORM</p>
<p>
<asp:Label ID="Label1" runat="server" Text="NAME"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="TextBox2" ErrorMessage="Age must be between 18 and 30"
ForeColor="Red" MaximumValue="30" MinimumValue="18"
style="z-index: 1; left: 546px; top: 97px; position: absolute; bottom: 332px"
ValidationGroup="*">*</asp:RangeValidator>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox3" ErrorMessage="enter the correct email format"
ForeColor="Red" style="z-index: 1; left: 545px; top: 140px; position:
absolute"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
ValidationGroup="*">*</asp:RegularExpressionValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" ErrorMessage="ENTER THE NAME" ForeColor="Red"
style="z-index: 1; left: 545px; top: 55px; position: absolute; height: 18px;
width: 6px;"
ValidationGroup="*">*</asp:RequiredFieldValidator>
</p>
<p>
<asp:Label ID="Label5" runat="server" Text="AGE"></asp:Label>
&nbsp;&nbsp;&nbsp;<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
&nbsp;&nbsp;
</p>
<p>
<asp:Label ID="Label4" runat="server" Text="EMAIL"></asp:Label>
&nbsp;&nbsp;<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
&nbsp;</p>
<p>
<asp:Label ID="Label3" runat="server" Text="PASSWORD"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" TextMode="Password"></asp:TextBox>
</p>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red"
style="z-index: 1; left: 220px; top: 356px; position: absolute; height: 38px;
width: 410px"
ValidationGroup="*" />
<p>
<asp:Label ID="Label2" runat="server" Text="CONFIRM PASSWORD"></asp:Label>
<asp:TextBox ID="TextBox5" runat="server" TextMode="Password"></asp:TextBox>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox4" ControlToValidate="TextBox5"
ErrorMessage="PASSWORD MISMATCH" ForeColor="#FF3300"
style="z-index: 1; left: 547px; top: 193px; position: absolute; width: 9px;"
ValidationGroup="*">*</asp:CompareValidator>
</p>
<p>
<asp:Button ID="Button1" runat="server" Text="SUBMIT" ValidationGroup="*" />
</p>
</form>
</body>
</html>

DEFAULT.ASPX.VB

Partial Class Reg


Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
If (Page.IsValid = True) Then
Response.Redirect("thankyou.aspx")

End If
End Sub
End Class
THANKYOU.ASPX

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Thankyou.aspx.vb"


Inherits="Thankyou" %>

<!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 id="Head1" runat="server">
<title></title>
<style type="text/css">
.style1
{
font-family: "Bodoni MT";
}
</style>
</head>
<body style="font-size: larger; font-family: 'Baskerville Old Face'">
<p style="text-align: center">
&nbsp;</p>
<p class="style1"
style="text-align: center; font-size: xx-large; color: #0000FF; font-weight: 700;
font-style: italic">
THANK YOU&nbsp;
</p>
<p style="text-align: center; font-size: xx-large; color: #0000FF; font-weight: 700;
font-style: italic">
&nbsp;</p>
<p style="text-align: justify">
&nbsp;</p>
</body>
</html>
13.DESIGNING A WEBPAGE

AIM:

To design a webpage in asp.net.

ALGORITHM:

Step 1: Start the process.

Step 2: Open a new website.

Step 3: In design, add some images, and datas about the webpage.

Step 4:Add hyperlinks to the images in properties.

Step 5:Give some css to the webpage.

Step 6: Run the program.

Step 7: Stop the process


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">

<html xmlns="http://www.w3.org/1999/xhtml" >


<head id="Head1" runat="server">
<title>Untitled Page</title>
<style type="text/css">
a:link{color:#1a0dab;cursor:pointer}a{font-family:arial,sans-serif;-ms-tap-highlight-
color:rgba(255,255,255,0)}</style>
</head>
<body>
<form id="form1" runat="server">
<div style="font-family: 'Times New Roman', Times, serif; font-size: x-large; font-
weight: 100">

<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a
href="http://www.google.co.in/url?
url=http://precisionenggworks.com/pew/centrifugal-monoblock-
pumps.html&amp;rct=j&amp;frm=1&amp;q=&amp;esrc=s&amp;sa=U&amp;ved=0ahUKEwiq-
Mq04pXPAhUMuo8KHb8YDPYQwW4ILzAN&amp;usg=AFQjCNEYAm-3o4hfIiGKYMBucA04QJE1_w"><img
alt="Image result for images of pumps" height="100"
src="https://encrypted-tbn3.gstatic.com/images?
q=tbn:ANd9GcQJvqXeGNfRZs6rCyAzPpnTXhhcQS8cVblMJjC0UEKuvRzkg6tc_PTpAgY"
width="130"
/></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://www.google.co.in/url?url=http://www.madinapolymer.com/e-
brochure/water-pump/&amp;rct=j&amp;frm=1&amp;q=&amp;esrc=s&amp;sa=U&amp;ved=0ahUKEwiq-
Mq04pXPAhUMuo8KHb8YDPYQwW4IOTAS&amp;usg=AFQjCNE4yQmxIQnXEshDyN4MyYlLFFa6Jg">
<img alt="Image result for images of pumps" height="90"
src="https://encrypted-tbn0.gstatic.com/images?
q=tbn:ANd9GcQ3ulLLi0shVtpqu_dYjU9SW8b5lw3RaeOFggHA7I7tXGd105ef6B0O9Fcl"
width="128" /></a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AR PUMPS<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
AR&nbsp; pumps are specially designed for industrial and agricultural uses. Its
impeller even pumps the dirty water.Compact,Simple and reliable to use.<br />
&nbsp;&nbsp;
<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;
Lower the cost!!!<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Higher the perfection!!!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
<a href="https://www.google.co.in/url?url=https://www.ksb.com/ksb-
en/Product_Types/centrifugal-
pump/&amp;rct=j&amp;frm=1&amp;q=&amp;esrc=s&amp;sa=U&amp;ved=0ahUKEwiq-
Mq04pXPAhUMuo8KHb8YDPYQwW4IKTAK&amp;usg=AFQjCNG3qMHvEivNpMdcjBkcnM_oqbpZTg">
<img alt="Image result for images of pumps" height="89"
src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTD8pL1KBVZ7-
GblzMRRBrENfxgrvym1DoCei6oa9czFrRuzUGq-v62Xrk"
width="137" /></a><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />

</div>
</form>
</body>
</html>
OUTPUT:-
14.STUDENT MARKS PROCESSING APPLICATION

AIM:

To create windows application to develop student mark list

ALGORITHM:

Step 1: Start the process.

Step 2: Open ms access and create a database.

Step 3: Create a table with required fields and save it

Step 4: Open visual studio and select create project in windows application

Step 5: connect the database into the vb.net using data connection icon in
server explorer Microsoft access oledb connection

Step 6: Add textboxes, tables and buttons in the form type the necessary
coding to find the mark .

Step 7: save and execute the program

Step 8: stop the process


FORM1.VB

Public Class Form1

Private Sub StumrkBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles StumrkBindingNavigatorSaveItem.Click
Me.Validate()
Me.StumrkBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.StumrksDataSet)

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 'StumrksDataSet.stumrk' table. You
can move, or remove it, as needed.
Me.StumrkTableAdapter.Fill(Me.StumrksDataSet.stumrk)

End Sub

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


Handles Button1.Click
TotalTextBox.Text = Val(Mark1TextBox.Text) + Val(Mark2TextBox.Text) +
Val(Mark3TextBox.Text) + Val(Mark4TextBox.Text)
End Sub

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


Handles Button2.Click
PercentageTextBox.Text = Val(TotalTextBox.Text) / 4
End Sub

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


Handles Button3.Click
Reg_noTextBox.Text = ""
SNameTextBox.Text = ""
Mark1TextBox.Text = ""
Mark2TextBox.Text = ""
Mark3TextBox.Text = ""
Mark4TextBox.Text = ""
TotalTextBox.Text = ""
PercentageTextBox.Text = ""
End Sub

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


Handles Button4.Click
End
End Sub
End Class
FORM1 DESIGN:-

OUTPUT:-
15.EMPLOYEE PAYROLL SYSTEM

AIM:

To create web application to develop employee payroll system

ALGORITHM:

Step 1: Start the process

Step 2: Open ms access and create a database

Step 3: Create a table with required fields and save it

Step 4: Open visual studio and select create project in windows application

Step 5: connect the database using data connection icon in server explorer.
Microsoft access oledb connection

Step 6: Select and Drop the View Control from the Data Toolbox and change the
display as per the choice to detailview or Gridview.

Step7: Create one button for calculating the GROSSPAY, health allowance, tax and
netsalary. In Calculate button write the code for calculating the above things.

Step 8: save and execute the program

Step 9: stop the process


FORM1.VB

Public Class Form1

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


As System.EventArgs) Handles EmdbBindingNavigatorSaveItem.Click
Me.Validate()
Me.EmdbBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.EmdbDataSet)

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 'EmdbDataSet.emdb' table. You can
move, or remove it, as needed.
Me.EmdbTableAdapter.Fill(Me.EmdbDataSet.emdb)

End Sub

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


Handles Button1.Click

Gross_payTextBox.Text = Val(Val(Days_weekTextBox.Text * 4)) *


Val(Rate_dayTextBox.Text)
_15__tax_of_monthly_wagesTextBox.Text = Val(Gross_payTextBox.Text) * 0.3
Healthallowance_5_TextBox.Text = Val(Gross_payTextBox.Text) * 0.1

DeductionTextBox.Text = Val(_15__tax_of_monthly_wagesTextBox.Text) +
Val(Healthallowance_5_TextBox.Text)
NetsalaryTextBox.Text = Val(Gross_payTextBox.Text) - Val(DeductionTextBox.Text)

End Sub
End Class

FORM DESIGN:-
OUTPUT:-

You might also like