You are on page 1of 83

Name:-Ravi Singh

Roll No:-26

Name :- Ravi Singh


Roll No :-26
Subject :- 505 ASP.Net
SPID :-2021057987
Class :- TY B.C.A(FIFTH SEMESTER)

1
Name:-Ravi Singh
Roll No:-26

Q1. Library Management System

Login Page

Input :-

Login.aspx

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


%>

<!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:Label ID="Label1" runat="server" Text="User Name"></asp:Label>

<asp:TextBox ID="TextBox1" runat="server" Height="80px"

style="margin-left: 70px" Width="558px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" Height="80px"

style="margin-left: 38px" Width="558px"></asp:TextBox>

2
Name:-Ravi Singh
Roll No:-26

<br />

<br />

<asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="False"

NavigateUrl="~/reg.aspx">registration</asp:HyperLink>

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

<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="59px"

style="margin-left: 38px" Text="Login" Width="555px" />

<br />

<br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>

</form>

</body>

</html>

Login.aspx.vb

Imports System.Data.SqlClient

Partial Class login

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "select count(*) from reg where username='" & TextBox1.Text & "' and pass='" &
TextBox2.Text & "' "

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

3
Name:-Ravi Singh
Roll No:-26

str1 = cmd.ExecuteScalar

cnn.Close()

If str1 > 0 Then

Response.Redirect("showall.aspx")

Else

MsgBox("data not found")

End If

End Sub

End Class

Output:-

Registration page

4
Name:-Ravi Singh
Roll No:-26

Input:-

Registration.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="reg.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 runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label ID="Label1" runat="server" Text="User Name"></asp:Label>

<asp:TextBox ID="TextBox1" runat="server" Height="58px"

style="margin-left: 79px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" Height="58px"

style="margin-left: 51px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label3" runat="server" Text="Name"></asp:Label>

<asp:TextBox ID="TextBox3" runat="server" Height="58px"

style="margin-left: 123px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label4" runat="server" Text="Age"></asp:Label>

<asp:TextBox ID="TextBox4" runat="server" Height="58px"

5
Name:-Ravi Singh
Roll No:-26

style="margin-left: 134px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label5" runat="server" Text="Phone No"></asp:Label>

<asp:TextBox ID="TextBox5" runat="server" Height="58px"

style="margin-left: 86px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="40px"

Text="registration" Width="682px" />

<br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>

</form>

</body>

</html>

Registration.aspx.vb

Imports System.Data.SqlClient

Partial Class reg

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "insert into reg(username,pass,name,age,phone)values('" & TextBox1.Text & "','" &


TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"

6
Name:-Ravi Singh
Roll No:-26

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteNonQuery

cnn.Close()

If str1 = True Then

MsgBox("registration complete")

Response.Redirect("login.aspx")

End If

End Sub

End Class

Output:-

Master Page

Input:-

Masterpage.master

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

7
Name:-Ravi Singh
Roll No:-26

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

<asp:ContentPlaceHolder id="head" runat="server">

</asp:ContentPlaceHolder>

<style type="text/css">

.style1

width: 1000px;

border-style: solid;

border-width: 2px;

.style2

height: 49px;

.style3

width: 1000px;

.style4

width: 245px;

</style>

</head>

<body>

8
Name:-Ravi Singh
Roll No:-26

<form id="form1" runat="server">

<div>

<table align="center" class="style1">

<tr>

<td class="style2">

<h1 align="center" style="background-color: #6699FF">

Library Management System

</h1>

</td>

</tr>

<tr>

<td>

<table align="center" class="style3">

<tr>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/add.aspx"

Font-Underline="False">Add Book</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/update.aspx"

Font-Underline="False">Update Book</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/delete.aspx"

Font-Underline="False">Delete Book</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/srcbook.aspx"

9
Name:-Ravi Singh
Roll No:-26

Font-Underline="False">Search Book</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="~/showall.aspx"

Font-Underline="False">Show All Book</asp:HyperLink>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>

<table class="style3">

<tr>

<td class="style4">

<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/add.aspx"

Font-Underline="False">Add Book</asp:HyperLink>

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink7" runat="server" NavigateUrl="~/update.aspx"

Font-Underline="False">Update Book</asp:HyperLink>

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl="~/delete.aspx"

10
Name:-Ravi Singh
Roll No:-26

Font-Underline="False">Delete Book</asp:HyperLink>

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink9" runat="server" NavigateUrl="~/srcbook.aspx"

Font-Underline="False">Search Book</asp:HyperLink>

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink10" runat="server"


NavigateUrl="~/showall.aspx"

Font-Underline="False">Show All Book</asp:HyperLink>

<br />

</td>

<td align="left" colspan="1" rowspan="1">

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>

<p align="right"

style="background-color: #0066FF; font-family: Arial, Helvetica, sans-serif; font-size:


large; color: #FFFFFF;">© Copyrights © 2022 – 2023 Xyz Company. </p>

11
Name:-Ravi Singh
Roll No:-26

</td>

</tr>

</table>

</div>

</form>

</body>

</html>

Output:-

Add Book

Input:-

Add Book.aspx

12
Name:-Ravi Singh
Roll No:-26

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"


AutoEventWireup="false" CodeFile="add.aspx.vb" Inherits="add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<p>

<asp:Label ID="Label2" runat="server" Text="isbn_no"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" style="margin-left: 38px"

Height="53px" Width="612px"></asp:TextBox>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [Table1]"></asp:SqlDataSource>

</p>

<p>

<asp:Label ID="Label3" runat="server" Text="author"></asp:Label>

<asp:TextBox ID="TextBox3" runat="server" style="margin-left: 49px"

Height="42px" Width="636px"></asp:TextBox>

</p>

<p>

<asp:Label ID="Label4" runat="server" Text="no of book"></asp:Label>

<asp:TextBox ID="TextBox4" runat="server" style="margin-left: 13px"

Height="42px" Width="632px"></asp:TextBox>

</p>

<p>

<asp:Label ID="Label5" runat="server" Text="price"></asp:Label>

<asp:TextBox ID="TextBox5" runat="server" style="margin-left: 53px"

Height="40px" Width="634px"></asp:TextBox>

<br />

</p>

13
Name:-Ravi Singh
Roll No:-26

<p>

<asp:Label ID="Label6" runat="server" Text="title"></asp:Label>

<asp:TextBox ID="TextBox6" runat="server" style="margin-left: 62px"

Height="48px" Width="635px"></asp:TextBox>

</p>

<p>

<asp:Button ID="Button1" runat="server" Text="Submit" Width="361px"

BackColor="Lime" Height="43px" />

</p>

</asp:Content>

Add Book.aspx.vb

Imports System.Data.SqlClient

Partial Class add

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "insert into table1 (isbn_no,author,no_of_book,price,title)values('" & TextBox2.Text & "','"


& TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "')"

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteNonQuery

cnn.Close()

If str1 = True Then

Response.Redirect("showall.aspx")

End If

End Sub

14
Name:-Ravi Singh
Roll No:-26

End Class

Output:-

Update Book

Input:-

Update.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"


AutoEventWireup="false" CodeFile="update.aspx.vb" Inherits="update" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>

15
Name:-Ravi Singh
Roll No:-26

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<p>

<asp:Label ID="Label2" runat="server" Text="isbn_no"></asp:Label>

</p>

<p>

<asp:DropDownList ID="DropDownList1" runat="server" Height="38px" Width="740px">

</asp:DropDownList>

</p>

<p>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [Table1]"></asp:SqlDataSource>

</p>

<p>

<asp:Label ID="Label3" runat="server" Text="author"></asp:Label>

<asp:TextBox ID="TextBox3" runat="server" style="margin-left: 49px"

Height="42px" Width="636px"></asp:TextBox>

</p>

<p>

<asp:Label ID="Label4" runat="server" Text="no of book"></asp:Label>

<asp:TextBox ID="TextBox4" runat="server" style="margin-left: 13px"

Height="42px" Width="632px"></asp:TextBox>

</p>

<p>

<asp:Label ID="Label5" runat="server" Text="price"></asp:Label>

<asp:TextBox ID="TextBox5" runat="server" style="margin-left: 53px"

Height="40px" Width="634px"></asp:TextBox>

<br />

16
Name:-Ravi Singh
Roll No:-26

</p>

<p>

<asp:Label ID="Label6" runat="server" Text="title"></asp:Label>

<asp:TextBox ID="TextBox6" runat="server" style="margin-left: 62px"

Height="48px" Width="635px"></asp:TextBox>

</p>

<p>

<asp:Button ID="Button1" runat="server" Text="Submit" Width="361px"

BackColor="Lime" Height="43px" />

</p>

</asp:Content>

Update.aspx.vb

Imports System.Data.SqlClient

Partial Class update

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "select isbn_no from table1"

Dim cmd As New SqlCommand(str, cnn)

Dim dr As SqlDataReader

cnn.Open()

dr = cmd.ExecuteReader

While dr.Read

DropDownList1.Items.Add(dr.Item(0))

End While

17
Name:-Ravi Singh
Roll No:-26

cnn.Close()

End Sub

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

str = "update table1 set author='" & TextBox3.Text & "',no_of_book='" & TextBox4.Text &
"',price='" & TextBox5.Text & "',title='" & TextBox6.Text & "' where isbn_no='" &
DropDownList1.SelectedValue & "'"

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteNonQuery

cnn.Close()

If str1 = True Then

MsgBox("book deteils update succesfully")

Response.Redirect("showall.aspx")

End If

End Sub

End Class

Output:-

Delete Book

18
Name:-Ravi Singh
Roll No:-26

Input:-

Delete.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"


AutoEventWireup="false" CodeFile="delete.aspx.vb" Inherits="delete" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:Label ID="Label1" runat="server"

Text="select book which you want to delete"></asp:Label>

<br />

<br />

<asp:DropDownList ID="DropDownList1" runat="server" Height="137px" Width="333px">

</asp:DropDownList>

<br />

<br />

<asp:Button ID="Button1" runat="server" BackColor="Lime" Text="Delete"

Width="351px" Height="44px" />

<br />

</asp:Content>

Delete.aspx.vb

Imports System.Data.SqlClient

19
Name:-Ravi Singh
Roll No:-26

Partial Class delete

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "select title from table1"

Dim cmd As New SqlCommand(str, cnn)

Dim dr As SqlDataReader

cnn.Open()

dr = cmd.ExecuteReader

While dr.Read

DropDownList1.Items.Add(dr.Item(0))

End While

cnn.Close()

End Sub

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

str = "delete from table1 where title='" & DropDownList1.SelectedValue & "'"

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteNonQuery

cnn.Close()

If str1 = True Then

MsgBox("book delete succesfully")

Response.Redirect("showall.aspx")

End If

End Sub

End Class

20
Name:-Ravi Singh
Roll No:-26

Output:-

Search Book

Input:-

Srchbook.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"


AutoEventWireup="false" CodeFile="srcbook.aspx.vb" Inherits="srcbook" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

21
Name:-Ravi Singh
Roll No:-26

Search by Title<br />

<asp:TextBox ID="TextBox1" runat="server" Height="83px" Width="328px"></asp:TextBox>

<asp:Button ID="Button1" runat="server" Height="57px" style="margin-left: 37px"

Text="Search" Width="278px" />

<br />

<br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [Table1]"></asp:SqlDataSource>

<br />

<br />

<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"

GridLines="None" Height="112px" Width="729px">

<AlternatingRowStyle BackColor="White" ForeColor="#284775" />

<EditRowStyle BackColor="#999999" />

<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />

<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />

<SortedAscendingCellStyle BackColor="#E9E7E2" />

<SortedAscendingHeaderStyle BackColor="#506C8C" />

<SortedDescendingCellStyle BackColor="#FFFDF8" />

<SortedDescendingHeaderStyle BackColor="#6F8DAE" />

</asp:GridView>

<br />

<br /><br />

</asp:Content>

22
Name:-Ravi Singh
Roll No:-26

Srchbook.aspx.vb

Imports System.Data.SqlClient

Partial Class srcbook

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "select * from table1 where title ='" & TextBox1.Text & "'"

Dim cmd As New SqlCommand(str, cnn)

Dim da As New SqlDataAdapter(cmd)

Dim ds As New Data.DataSet

da.Fill(ds)

cnn.Open()

GridView1.DataSource = ds.Tables(0)

GridView1.DataBind()

cnn.Close()

End Sub

End Class

Output:-

23
Name:-Ravi Singh
Roll No:-26

Show All Book

Input:-

Showall.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master"


AutoEventWireup="false" CodeFile="showall.aspx.vb" Inherits="showall" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<p>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [Table1]"></asp:SqlDataSource>

<br />

<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"

GridLines="None" Height="155px" Width="739px">

<AlternatingRowStyle BackColor="White" ForeColor="#284775" />

<EditRowStyle BackColor="#999999" />

<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />

24
Name:-Ravi Singh
Roll No:-26

<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />

<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />

<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />

<SortedAscendingCellStyle BackColor="#E9E7E2" />

<SortedAscendingHeaderStyle BackColor="#506C8C" />

<SortedDescendingCellStyle BackColor="#FFFDF8" />

<SortedDescendingHeaderStyle BackColor="#6F8DAE" />

</asp:GridView>

</p>

<p></p>

<p></p>

<p></p>

<p></p>

</asp:Content>

Showall.aspx.vb

Imports System.Data.SqlClient

Partial Class showall

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "select * from table1"

Dim cmd As New SqlCommand(str, cnn)

Dim da As New SqlDataAdapter(cmd)

Dim ds As New Data.DataSet

da.Fill(ds)

cnn.Open()

25
Name:-Ravi Singh
Roll No:-26

GridView1.DataSource = ds.Tables(0)

GridView1.DataBind()

cnn.Close()

End Sub

End Class

Output:-

Registration Table

Library Data Table

26
Name:-Ravi Singh
Roll No:-26

Q2.Online Shopping Management System

Login page

Input:-

Login.aspx

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


%>

<!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:Label ID="Label1" runat="server" Text="User Name"></asp:Label>

<asp:TextBox ID="TextBox1" runat="server" Height="80px"

style="margin-left: 70px" Width="558px"></asp:TextBox>

<br />

27
Name:-Ravi Singh
Roll No:-26

<br />

<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" Height="80px"

style="margin-left: 38px" Width="558px"></asp:TextBox>

<br />

<br />

<asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="False"

NavigateUrl="~/reg.aspx">registration</asp:HyperLink>

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

<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="59px"

style="margin-left: 38px" Text="Login" Width="555px" />

<br />

<br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>

</form>

</body>

</html>

Login.aspx.vb

Imports System.Data.SqlClient

Partial Class login

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

28
Name:-Ravi Singh
Roll No:-26

str = "select count(*) from reg where username='" & TextBox1.Text & "' and pass='" &
TextBox2.Text & "' "

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteScalar

cnn.Close()

If str1 > 0 Then

Response.Redirect("show.aspx")

Else

MsgBox("data not found")

End If

End Sub

End Class

Output:-

Registration page

29
Name:-Ravi Singh
Roll No:-26

Input:-

Registration.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="reg.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 runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label ID="Label1" runat="server" Text="User Name"></asp:Label>

<asp:TextBox ID="TextBox1" runat="server" Height="58px"

style="margin-left: 79px" Width="488px"></asp:TextBox>

30
Name:-Ravi Singh
Roll No:-26

<br />

<br />

<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" Height="58px"

style="margin-left: 51px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label3" runat="server" Text="Name"></asp:Label>

<asp:TextBox ID="TextBox3" runat="server" Height="58px"

style="margin-left: 123px" Width="488px"></asp:TextBox>

<br />

<br />

<asp:Label ID="Label4" runat="server" Text="Age"></asp:Label>

<asp:TextBox ID="TextBox4" runat="server" Height="58px"

style="margin-left: 134px" Width="488px"></asp:TextBox>

<br /> <br />

<asp:Label ID="Label5" runat="server" Text="Phone No"></asp:Label>

<asp:TextBox ID="TextBox5" runat="server" Height="58px"

style="margin-left: 86px" Width="488px"></asp:TextBox>

<br /> <br />

<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="40px"

Text="registration" Width="682px" />

<br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>

</form>

31
Name:-Ravi Singh
Roll No:-26

</body>

</html>

Registration.aspx.vb

Imports System.Data.SqlClient

Partial Class reg

Inherits System.Web.UI.Page

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "insert into reg(username,pass,name,age,phone)values('" & TextBox1.Text & "','" &


TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteNonQuery

cnn.Close()

If str1 = True Then

MsgBox("registration complete")

Response.Redirect("login.aspx")

End If

End Sub

End Class

Output:-

32
Name:-Ravi Singh
Roll No:-26

Master page

Input:-

Home.master

<%@ Master Language="VB" CodeFile="home.master.vb" Inherits="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></title>

<asp:ContentPlaceHolder id="head" runat="server">

</asp:ContentPlaceHolder>

<style type="text/css">

.style1 {

width: 1000px;

.style2

33
Name:-Ravi Singh
Roll No:-26

width: 212px;

</style>

</head>

<body>

<form id="form1" runat="server">

<div>

<table align="center" class="style1">

<tr>

<td>

<h1 align="center"

style="background-color: #3399FF; font-family: &quot;Times New Roman&quot;,


Times, serif">

Shopping Management</h1></td>

</tr>

<tr>

<td>

<table align="center" class="style1">

<tr>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/add.aspx"

Font-Underline="False">Add Product</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/update.aspx"

Font-Underline="False">Update Product</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/delete.aspx"

34
Name:-Ravi Singh
Roll No:-26

Font-Underline="False">Delete Product</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/search.aspx"

Font-Underline="False">Search Product</asp:HyperLink>

</td>

<td align="center" width="159">

<asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="~/show.aspx"

Font-Underline="False">Show All Product</asp:HyperLink>

</td>

</tr>

</table>

</td>

</tr>

<tr>

<td>

<table class="style1">

<tr>

<td class="style2">

<br />

<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/add.aspx"

Font-Underline="False">Add Product</asp:HyperLink>

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink7" runat="server" NavigateUrl="~/update.aspx"

Font-Underline="False">Update Product</asp:HyperLink>

35
Name:-Ravi Singh
Roll No:-26

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl="~/delete.aspx"

Font-Underline="False">Delete Product</asp:HyperLink>

<br />

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink9" runat="server" NavigateUrl="~/search.aspx"

Font-Underline="False">Search Product</asp:HyperLink>

<br />

<br />

<br />

<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/show.aspx"

Font-Underline="False">Show All Product</asp:HyperLink>

<br />

</td>

<td>

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>

</td>

</tr>

</table>

</td>

</tr>

<tr>

36
Name:-Ravi Singh
Roll No:-26

<td>

<p align="right"

style="background-color: #3399FF; font-family: Arial, Helvetica, sans-serif; font-size:


large">

© Copyrights © 2022 – 2023 mycompany.

</p></td>

</tr>

</table>

</div>

</form>

</body>

</html>

Output:-

Add product page

37
Name:-Ravi Singh
Roll No:-26

Input:-

Add.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="add.aspx.vb" Inherits="add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<asp:Label ID="Label1" runat="server" Text="pid"></asp:Label>

&nbsp;

<asp:TextBox ID="TextBox1" runat="server" Height="41px" Width="730px"></asp:TextBox>

<br /><br />

<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>

<asp:TextBox ID="TextBox2" runat="server" Height="44px" Width="709px"></asp:TextBox>

<br /><br />

<asp:Label ID="Label3" runat="server" Text="Price"></asp:Label>

<asp:TextBox ID="TextBox3" runat="server" Height="45px" Width="716px"></asp:TextBox>

38
Name:-Ravi Singh
Roll No:-26

<br /><br />

<asp:Label ID="Label4" runat="server" Text="Quantity"></asp:Label>

<asp:TextBox ID="TextBox4" runat="server" Height="41px" Width="693px"></asp:TextBox>

<br /><br />

<asp:Label ID="Label5" runat="server" Text="Description"></asp:Label>

<asp:TextBox ID="TextBox5" runat="server" Height="39px"

style="margin-left: 9px" Width="661px"></asp:TextBox>

<br /><br />

<asp:Label ID="Label6" runat="server" Text="Categories"></asp:Label>

<asp:DropDownList ID="DropDownList1" runat="server" Height="88px" Width="688px">

<asp:ListItem>Clothes</asp:ListItem>

<asp:ListItem>electronic</asp:ListItem>

<asp:ListItem>food</asp:ListItem>

</asp:DropDownList>

<br /><br />

<asp:Button ID="Button1" runat="server" BackColor="#99FF99" Height="44px"

Text="Submit" Width="568px" />

<br /><br />

<asp:SqlDataSource ID="SqlDataSource1" runat="server"

ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

SelectCommand="SELECT * FROM [pro]"></asp:SqlDataSource>

<br />

</asp:Content>

add.aspx.vb

Imports System.Data.SqlClient

Partial Class add

Inherits System.Web.UI.Page

39
Name:-Ravi Singh
Roll No:-26

Dim cnn As New SqlConnection("Data


Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated
Security=True;User Instance=True")

Dim str, str1 As String

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

str = "insert into pro(pid,name,price,qnty,pdesc,categ)values('" & TextBox1.Text & "','" &


TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" &
DropDownList1.SelectedValue & "')"

Dim cmd As New SqlCommand(str, cnn)

cnn.Open()

str1 = cmd.ExecuteNonQuery

cnn.Close()

If str1 = True Then

MsgBox("Product added")

Response.Redirect("show.aspx")

End If

End Sub

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

End Sub

End Class

Output:-

40
Name:-Ravi Singh
Roll No:-26

Update product page

Input:-

Update.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="update.aspx.vb" Inherits="update" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="Label1" runat="server" Text="pid"></asp:Label>
&nbsp;
<asp:DropDownList ID="DropDownList2" runat="server" Height="37px" Width="730px">
</asp:DropDownList>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="44px" Width="709px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="Price"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="45px" Width="716px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label4" runat="server" Text="Quantity"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" Height="41px" Width="693px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label5" runat="server" Text="Description"></asp:Label>
<asp:TextBox ID="TextBox5" runat="server" Height="39px"
style="margin-left: 9px" Width="661px"></asp:TextBox>

41
Name:-Ravi Singh
Roll No:-26

<br />
<br />
<asp:Label ID="Label6" runat="server" Text="Categories"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" Height="88px" Width="688px">
<asp:ListItem>Clothes</asp:ListItem>
<asp:ListItem>electronic</asp:ListItem>
<asp:ListItem>food</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Button ID="Button1" runat="server" BackColor="#99FF99" Height="44px"
Text="Update" Width="568px" />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [pro]"></asp:SqlDataSource>
<br />
</asp:Content>
Update.aspx.vb

Imports System.Data.SqlClient
Partial Class update
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
str = "select pid from pro"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
While dr.Read
DropDownList2.Items.Add(dr.Item(0))
End While
cnn.Close()
End Sub
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "update pro set name='" & TextBox2.Text & "',price='" & TextBox3.Text & "',qnty='" & TextBox4.Text &
"',pdesc='" & TextBox5.Text & "',categ='" & DropDownList1.SelectedValue & "'where pid='" &
DropDownList2.SelectedValue & "'"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("Product Update succesfully")
Response.Redirect("show.aspx")
End If
End Sub
End Class

Output:-

42
Name:-Ravi Singh
Roll No:-26

Delete product page

Input:-

Delete.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="delete.aspx.vb" Inherits="delete" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
Select product name which you want to delete</p>
<p>
<asp:DropDownList ID="DropDownList1" runat="server" Height="47px" Width="778px">
</asp:DropDownList>
</p>
<p>

43
Name:-Ravi Singh
Roll No:-26

&nbsp;</p>
<p>
<asp:Button ID="Button1" runat="server" BackColor="#66FF99" Height="52px"
Text="Delete" Width="308px" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"></asp:SqlDataSource>
</p>
<p>
&nbsp;</p>
</asp:Content>
Delete.aspx.vb

Imports System.Data.SqlClient
Partial Class delete
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
str = "select name from pro"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
While dr.Read
DropDownList1.Items.Add(dr.Item(0))
End While
cnn.Close()
End Sub
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "delete from pro where name='" & DropDownList1.SelectedValue & "'"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("Product delete succesfully")
Response.Redirect("show.aspx")
End If
End Sub
End Class
Output:-

44
Name:-Ravi Singh
Roll No:-26

Search product page

Input:-

Search.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="search.aspx.vb" Inherits="search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [pro]"></asp:SqlDataSource>
</p>
<p>
<asp:Label ID="Label1" runat="server" Text="Sarch by name"></asp:Label>
&nbsp;
<asp:TextBox ID="TextBox1" runat="server" Height="47px" Width="360px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" BackColor="#99FF99" Height="40px"
Text="Search" Width="251px" />
</p>
<p>
&nbsp;</p>
<p>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" Height="144px" Width="750px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />

45
Name:-Ravi Singh
Roll No:-26

<SortedDescendingHeaderStyle BackColor="#6F8DAE" />


</asp:GridView>
<br /></p>
</asp:Content>

Search.aspx.vb

Imports System.Data.SqlClient
Partial Class search
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String

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


str = "select * from pro where name ='" & TextBox1.Text & "'"
Dim cmd As New SqlCommand(str, cnn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New Data.DataSet
cnn.Open()

da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
cnn.Close()
End Sub
End Class
Output:-

Show all product page

46
Name:-Ravi Singh
Roll No:-26

Input:-

Show.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="show.aspx.vb" Inherits="show" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [pro]"></asp:SqlDataSource>
<br />
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" Height="77px" Width="775px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</p>
</asp:Content>
show.aspx.vb

Imports System.Data.SqlClient
Partial Class show
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String

47
Name:-Ravi Singh
Roll No:-26

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


str = "select * from pro"
Dim cmd As New SqlCommand(str, cnn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New Data.DataSet
cnn.Open()
da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
cnn.Close()

End Sub
End Class
Output:-

Registration table

Product table

48
Name:-Ravi Singh
Roll No:-26

Q3. Collage Management System

Login page

Input:-

Login.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="login.aspx.vb" Inherits="login" %>


<!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:Label ID="Label1" runat="server" Text="User Name"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" Height="80px"
style="margin-left: 70px" Width="558px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="80px"
style="margin-left: 38px" Width="558px"></asp:TextBox>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="False"
NavigateUrl="~/reg.aspx">registration</asp:HyperLink>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="59px"
style="margin-left: 38px" Text="Login" Width="555px" />
<br />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource> </div>
</form>
</body>
</html>

49
Name:-Ravi Singh
Roll No:-26

Login.aspx.vb

Imports System.Data.SqlClient
Partial Class login
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "select count(*) from reg where username='" & TextBox1.Text & "' and pass='" & TextBox2.Text & "' "
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteScalar
cnn.Close()
If str1 > 0 Then
Response.Redirect("show.aspx")
Else
MsgBox("data not found")
End If
End Sub
End Class
Output:-

Registration page

50
Name:-Ravi Singh
Roll No:-26

Input:-

Registration.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="reg.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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Label ID="Label1" runat="server" Text="User Name"></asp:Label>


<asp:TextBox ID="TextBox1" runat="server" Height="58px"
style="margin-left: 79px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="58px"
style="margin-left: 51px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="58px"
style="margin-left: 123px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label4" runat="server" Text="Age"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" Height="58px"
style="margin-left: 134px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label5" runat="server" Text="Phone No"></asp:Label>
<asp:TextBox ID="TextBox5" runat="server" Height="58px"
style="margin-left: 86px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="40px"
Text="registration" Width="682px" />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>
</form>
</body>
</html>
Registration.aspx.vb

Imports System.Data.SqlClient
Partial Class reg
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String

51
Name:-Ravi Singh
Roll No:-26

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


str = "insert into reg(username,pass,name,age,phone)values('" & TextBox1.Text & "','" & TextBox2.Text & "','"
& TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("registration complete")
Response.Redirect("login.aspx")
End If
End Sub
End Class
Output:-

Master page

Input:-

Home.master

<%@ Master Language="VB" CodeFile="home.master.vb" Inherits="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></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1 {
width: 1000px;
}
.style2
{
width: 212px;
}
.style3
{

52
Name:-Ravi Singh
Roll No:-26

height: 26px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center" class="style1">
<tr>
<td>
<h1 align="center"
style="background-color: #3399FF; font-family: &quot;Times New Roman&quot;, Times, serif">
Collage Management</h1></td>
</tr>
<tr>
<td>
<table align="center" class="style1" bgcolor="#FF9933">
<tr>
<td align="center" width="159" class="style3">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/add.aspx"
Font-Underline="False" ForeColor="Black">Add Collage</asp:HyperLink>
</td>
<td align="center" width="159" class="style3">
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/update.aspx"
Font-Underline="False" ForeColor="Black">Update Collage</asp:HyperLink>
</td>
<td align="center" width="159" class="style3">
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/delete.aspx"
Font-Underline="False" ForeColor="Black">Delete Collage</asp:HyperLink>
</td>
<td align="center" width="159" class="style3">
<asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/search.aspx"
Font-Underline="False" ForeColor="Black">Search Collage</asp:HyperLink>
</td>
<td align="center" width="159" class="style3">
<asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="~/show.aspx"
Font-Underline="False" ForeColor="Black">Show All Collage</asp:HyperLink>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="style1">
<tr>
<td class="style2">
<br />
<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/add.aspx"
Font-Underline="False">Add Collage</asp:HyperLink>
<br />
<br />
<br />
<br />
<asp:HyperLink ID="HyperLink7" runat="server" NavigateUrl="~/update.aspx"
Font-Underline="False">Update Collage</asp:HyperLink>
<br />
<br />
<br />
<br />
<asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl="~/delete.aspx"
Font-Underline="False">Delete Collage</asp:HyperLink>
<br />

53
Name:-Ravi Singh
Roll No:-26

<br />
<br />
<br />
<asp:HyperLink ID="HyperLink9" runat="server" NavigateUrl="~/search.aspx"
Font-Underline="False">Search Collage</asp:HyperLink>
<br />
<br />
<br />
<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/show.aspx"
Font-Underline="False">Show All Collage</asp:HyperLink>
<br />
</td>
<td>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<p align="right"
style="background-color: #3399FF; font-family: Arial, Helvetica, sans-serif; font-size: large">
© Copyrights © 2022 – 2023 collage.
</p></td>
</tr>
</table>
</div>
</form>
</body>
</html>
Output:-

Add collage page

54
Name:-Ravi Singh
Roll No:-26

Input:-

Add.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="add.aspx.vb" Inherits="add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<asp:Label ID="Label1" runat="server" Text="Cid"></asp:Label>
&nbsp;<asp:TextBox ID="TextBox1" runat="server" Height="41px" Width="711px"></asp:TextBox>
</p>
<p>
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="41px" Width="711px"></asp:TextBox>
</p>
<p>
<asp:Label ID="Label3" runat="server" Text="Address"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="47px" Width="697px"></asp:TextBox>
<br />
</p>
<p>
<asp:Label ID="Label4" runat="server" Text="Contact"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" Height="46px" Width="707px"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" BackColor="#99FF99" Height="56px"
Text="Submit" Width="593px" />
</p>
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [clg]"></asp:SqlDataSource>
</p>
<p>
&nbsp;</p>
</asp:Content>
Add.aspx.vb

55
Name:-Ravi Singh
Roll No:-26

Imports System.Data.SqlClient
Partial Class add
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "insert into clg(cid,name,address,contact)values('" & TextBox1.Text & "','" & TextBox2.Text & "','" &
TextBox3.Text & "','" & TextBox4.Text & "')"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("Collage added ")
Response.Redirect("show.aspx")
End If
End Sub
End Class
Output:-

Update collage page

56
Name:-Ravi Singh
Roll No:-26

Input:-

Update.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="update.aspx.vb" Inherits="update" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
</p>
<p>
<asp:Label ID="Label1" runat="server" Text="Cid"></asp:Label>
&nbsp;<asp:DropDownList ID="DropDownList1" runat="server" Height="36px" Width="727px">
</asp:DropDownList>
</p>
<p>
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="41px" Width="711px"></asp:TextBox>
</p>
<p>
<asp:Label ID="Label3" runat="server" Text="Address"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="47px" Width="697px"></asp:TextBox>
<br />
</p>
<p>
<asp:Label ID="Label4" runat="server" Text="Contact"></asp:Label>
<asp:TextBox ID="TextBox4" runat="server" Height="46px" Width="707px"></asp:TextBox>
</p>
<p>
<asp:Button ID="Button1" runat="server" BackColor="#99FF99" Height="56px"
Text="Submit" Width="593px" />
</p>
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [clg]"></asp:SqlDataSource>
</p>
<p>
&nbsp;</p>
</asp:Content>
Update.aspx.vb

Imports System.Data.SqlClient
Partial Class update
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
str = "select cid from clg"
Dim cmd As New SqlCommand(str, cnn)
Dim dr As SqlDataReader
cnn.Open()
dr = cmd.ExecuteReader
While dr.Read
DropDownList1.Items.Add(dr.Item(0))
End While
cnn.Close()
End Sub

57
Name:-Ravi Singh
Roll No:-26

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


str = "update clg set name='" & TextBox2.Text & "',address='" & TextBox3.Text & "',contact='" &
TextBox4.Text & "' where cid='" & DropDownList1.SelectedValue & "'"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("details updated")
Response.Redirect("show.aspx")
End If
End Sub
End Class
Output:-

Delete collage page

Input:-

Delete.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="delete.aspx.vb" Inherits="delete" %>

58
Name:-Ravi Singh
Roll No:-26

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [clg]"></asp:SqlDataSource>
&nbsp; Select collage name which you want to delete</p>
<p>
<asp:DropDownList ID="DropDownList1" runat="server" Height="26px" Width="770px">
</asp:DropDownList>
<br />
</p>
<p>
<asp:Button ID="Button1" runat="server" BackColor="#99FF66" Height="42px"
Text="Delete" Width="292px" />
</p>
</asp:Content>
Delete.aspx.vb

Imports System.Data.SqlClient
Partial Class delete
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
str = "select name from clg"
Dim cmd As New SqlCommand(str, cnn)
Dim dr As SqlDataReader
cnn.Open()

dr = cmd.ExecuteReader
While dr.Read
DropDownList1.Items.Add(dr.Item(0))
End While
cnn.Close()
End Sub
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "delete from clg where name='" & DropDownList1.SelectedValue & "'"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("collage details delete succesfully")
Response.Redirect("show.aspx")
End If
End Sub
End Class
Output:-

59
Name:-Ravi Singh
Roll No:-26

Search collage page

Input:-

Search.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="search.aspx.vb" Inherits="search" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<br />
Search by name
<asp:TextBox ID="TextBox1" runat="server" Height="45px" Width="299px"></asp:TextBox>
&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" BackColor="#99FF33" Height="46px"
Text="Search" Width="241px" />
</p>
<p>
&nbsp;</p>
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

60
Name:-Ravi Singh
Roll No:-26

SelectCommand="SELECT * FROM [clg]"></asp:SqlDataSource>


<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" Height="169px" Width="747px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</p>
<p>
&nbsp;</p>
</asp:Content>
Search.aspx.vb

Imports System.Data.SqlClient
Partial Class search
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "select * from clg where name='" & TextBox1.Text & "'"
Dim cmd As New SqlCommand(str, cnn)
Dim da As New SqlDataAdapter(cmd)
cnn.Open()
Dim ds As New Data.DataSet
da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
cnn.Close()
End Sub
End Class
Output:-

61
Name:-Ravi Singh
Roll No:-26

Show all collage page

Input:-

Show.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="show.aspx.vb" Inherits="show" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [clg]"></asp:SqlDataSource>
</p><p>
</p><p>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" Width="753px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</p>
</asp:Content>
Show.aspx.vb

Imports System.Data.SqlClient
Partial Class show
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

62
Name:-Ravi Singh
Roll No:-26

str = "select * from clg"


Dim cmd As New SqlCommand(str, cnn)
Dim da As New SqlDataAdapter(cmd)
cnn.Open()
Dim ds As New Data.DataSet
da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
cnn.Close()
End Sub
End Class
Output:-

Registration data page

Collage data page

63
Name:-Ravi Singh
Roll No:-26

Q4. Online Ticket Management System

Login page

Input:-

Login.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="login.aspx.vb" Inherits="login" %>

<!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:Label ID="Label1" runat="server" Text="User Name"></asp:Label>


<asp:TextBox ID="TextBox1" runat="server" Height="80px"
style="margin-left: 70px" Width="558px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="80px"
style="margin-left: 38px" Width="558px"></asp:TextBox>
<br />
<br />
<asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="False"
NavigateUrl="~/reg.aspx">registration</asp:HyperLink>
&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="59px"
style="margin-left: 38px" Text="Login" Width="555px" />
<br />
<br />

64
Name:-Ravi Singh
Roll No:-26

<asp:SqlDataSource ID="SqlDataSource1" runat="server"


ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>
</form>
</body>
</html>
Login.aspx.vb

Imports System.Data.SqlClient
Partial Class login
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String

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


str = "select count(*) from reg where username='" & TextBox1.Text & "' and pass='" & TextBox2.Text & "' "
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteScalar
cnn.Close()
If str1 > 0 Then
Response.Redirect("show.aspx")
Else
MsgBox("data not found")
End If
End Sub
End Class
Output:-

Registration page

65
Name:-Ravi Singh
Roll No:-26

Input:-

Registration.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="reg.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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Label ID="Label1" runat="server" Text="User Name"></asp:Label>


<asp:TextBox ID="TextBox1" runat="server" Height="58px"
style="margin-left: 79px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="User Password"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="58px"
style="margin-left: 51px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="58px"
style="margin-left: 123px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label4" runat="server" Text="Age"></asp:Label>

66
Name:-Ravi Singh
Roll No:-26

<asp:TextBox ID="TextBox4" runat="server" Height="58px"


style="margin-left: 134px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label5" runat="server" Text="Phone No"></asp:Label>
<asp:TextBox ID="TextBox5" runat="server" Height="58px"
style="margin-left: 86px" Width="488px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="40px"
Text="registration" Width="682px" />
<br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [reg]"></asp:SqlDataSource>

</div>
</form>
</body>
</html>
Registration.aspx.vb

Imports System.Data.SqlClient
Partial Class reg
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "insert into reg(username,pass,name,age,phone)values('" & TextBox1.Text & "','" & TextBox2.Text & "','"
& TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "')"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("registration complete")
Response.Redirect("login.aspx")
End If
End Sub
End Class
Output:-

67
Name:-Ravi Singh
Roll No:-26

Master page

Input:-

Home.master

<%@ Master Language="VB" CodeFile="home.master.vb" Inherits="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></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1 {
width: 1000px;
}
.style2
{
width: 212px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center" class="style1">
<tr>
<td>
<h1 align="center"
style="background-color: #3399FF; font-family: &quot;Times New Roman&quot;, Times, serif">
Movies Ticket Management</h1></td>
</tr>
<tr>
<td>
<table align="center" class="style1">

68
Name:-Ravi Singh
Roll No:-26

<tr>
<td align="center" width="159">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/add.aspx"
Font-Underline="False">Add Movie Ticket</asp:HyperLink>
</td>
<td align="center" width="159">
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/update.aspx"
Font-Underline="False">Update Movie Ticket</asp:HyperLink>
</td>
<td align="center" width="159">
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/delete.aspx"
Font-Underline="False">Delete Movie Ticket</asp:HyperLink>
</td>
<td align="center" width="159">
<asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/search.aspx"
Font-Underline="False">Search Movie Ticket</asp:HyperLink>
</td>
<td align="center" width="159">
<asp:HyperLink ID="HyperLink5" runat="server" NavigateUrl="~/show.aspx"
Font-Underline="False">Show All Movie Ticket</asp:HyperLink>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="style1">
<tr>
<td class="style2" bgcolor="#FF9999">
<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/add.aspx"
Font-Underline="False" ForeColor="Black">Add Movie Ticket</asp:HyperLink>
<br />
<br />
&nbsp;
<br />
<br />
<br />
<br />
<asp:HyperLink ID="HyperLink7" runat="server" NavigateUrl="~/update.aspx"
Font-Underline="False" ForeColor="Black">Update Movie Ticket</asp:HyperLink>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl="~/delete.aspx"
Font-Underline="False" ForeColor="Black">Delete Movie Ticket</asp:HyperLink>
<br />
<br />
<br />
<br />
<br />
<br />
<asp:HyperLink ID="HyperLink9" runat="server" NavigateUrl="~/search.aspx"
Font-Underline="False" ForeColor="Black">Search Movie Ticket</asp:HyperLink>
<br />
<br />
<br />
<br />
<br />

69
Name:-Ravi Singh
Roll No:-26

<asp:HyperLink ID="HyperLink10" runat="server" NavigateUrl="~/show.aspx"


Font-Underline="False" ForeColor="Black">Show All Movie Ticket</asp:HyperLink>
<br />
</td>
<td>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<p align="right"
style="background-color: #3399FF; font-family: Arial, Helvetica, sans-serif; font-size: large">
© Copyrights © 2022 – 2023 Ravi Multiplex.
</p></td>
</tr>
</table>
</div>
</form>
</body>
</html>
Output:-

Add movie ticket page

70
Name:-Ravi Singh
Roll No:-26

Input:-

Add.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="add.aspx.vb" Inherits="add" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="Label1" runat="server" Text="Id"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="Seat"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label4" runat="server" Text="Date"></asp:Label>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White"
BorderColor="Black" DayNameFormat="Shortest" Font-Names="Times New Roman"
Font-Size="10pt" ForeColor="Black" Height="99px" NextPrevFormat="FullMonth"
style="margin-left: 0px" TitleFormat="Month" Width="763px">
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt"
ForeColor="#333333" Height="10pt" />
<DayStyle Width="14%" />
<NextPrevStyle Font-Size="8pt" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#999999" />

71
Name:-Ravi Singh
Roll No:-26

<SelectedDayStyle BackColor="#CC3333" ForeColor="White" />


<SelectorStyle BackColor="#CCCCCC" Font-Bold="True" Font-Names="Verdana"
Font-Size="8pt" ForeColor="#333333" Width="1%" />
<TitleStyle BackColor="Black" Font-Bold="True" Font-Size="13pt"
ForeColor="White" Height="14pt" />
<TodayDayStyle BackColor="#CCCC99" />
</asp:Calendar>
<br />
<br />
<asp:Label ID="Label5" runat="server" Text="Time"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" Height="32px" Width="719px">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>6:30pm</asp:ListItem>
<asp:ListItem>7:20pm</asp:ListItem>
<asp:ListItem>9:00pm</asp:ListItem>
<asp:ListItem>9:45pm</asp:ListItem>
<asp:ListItem>10:30pm</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Label ID="Label6" runat="server" Text="Price"></asp:Label>
<asp:TextBox ID="TextBox6" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label7" runat="server" Text="Class"></asp:Label>
<asp:DropDownList ID="DropDownList2" runat="server" Height="33px" Width="732px">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>Imperial</asp:ListItem>
<asp:ListItem>Platinum</asp:ListItem>
<asp:ListItem>Gold</asp:ListItem>
<asp:ListItem>Silver</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Button ID="Button1" runat="server" BackColor="#99FF66" Height="63px"
Text="Submit" Width="350px" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [movie]"></asp:SqlDataSource>
<br />
</asp:Content>

Add.aspx.vb

Imports System.Data.SqlClient
Partial Class add
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String

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


Try
str = "insert into movie (mid,name,seat,date,time,price,class)values('" & TextBox1.Text & "','" &
TextBox2.Text & "','" & TextBox3.Text & "','" & Calendar1.SelectedDate & "','" & DropDownList1.SelectedValue &
"','" & TextBox6.Text & "','" & DropDownList2.SelectedValue & "')"
Dim cmd As New SqlCommand(str, cnn)
cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then

72
Name:-Ravi Singh
Roll No:-26

MsgBox("movie added")
Response.Redirect("show.aspx")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub

End Class
Output:-

Update movies ticket page

73
Name:-Ravi Singh
Roll No:-26

Input:-

Update.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="update.aspx.vb" Inherits="update" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<br />
<asp:Label ID="Label1" runat="server" Text="Id"></asp:Label>
<asp:DropDownList ID="DropDownList3" runat="server" Height="32px" Width="719px">
</asp:DropDownList>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Name"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="Seat"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label4" runat="server" Text="Date"></asp:Label>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White"
BorderColor="Black" DayNameFormat="Shortest" Font-Names="Times New Roman"
Font-Size="10pt" ForeColor="Black" Height="99px" NextPrevFormat="FullMonth"
style="margin-left: 0px" TitleFormat="Month" Width="763px">
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt"

74
Name:-Ravi Singh
Roll No:-26

ForeColor="#333333" Height="10pt" />


<DayStyle Width="14%" />
<NextPrevStyle Font-Size="8pt" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#999999" />
<SelectedDayStyle BackColor="#CC3333" ForeColor="White" />
<SelectorStyle BackColor="#CCCCCC" Font-Bold="True" Font-Names="Verdana"
Font-Size="8pt" ForeColor="#333333" Width="1%" />
<TitleStyle BackColor="Black" Font-Bold="True" Font-Size="13pt"
ForeColor="White" Height="14pt" />
<TodayDayStyle BackColor="#CCCC99" />
</asp:Calendar>
<br />
<br />
<asp:Label ID="Label5" runat="server" Text="Time"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" Height="32px" Width="719px">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>6:30pm</asp:ListItem>
<asp:ListItem>7:20pm</asp:ListItem>
<asp:ListItem>9:00pm</asp:ListItem>
<asp:ListItem>9:45pm</asp:ListItem>
<asp:ListItem>10:30pm</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Label ID="Label6" runat="server" Text="Price"></asp:Label>
<asp:TextBox ID="TextBox6" runat="server" Height="46px" Width="718px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label7" runat="server" Text="Class"></asp:Label>
<asp:DropDownList ID="DropDownList2" runat="server" Height="33px" Width="732px">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem>Imperial</asp:ListItem>
<asp:ListItem>Platinum</asp:ListItem>
<asp:ListItem>Gold</asp:ListItem>
<asp:ListItem>Silver</asp:ListItem>
</asp:DropDownList>
<br />
<br />
<asp:Button ID="Button1" runat="server" BackColor="#99FF66" Height="63px"
Text="Submit" Width="350px" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [movie]"></asp:SqlDataSource>
<br />
</p>
</asp:Content>

Update.aspx.vb

Imports System.Data.SqlClient
Partial Class update
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
str = "select mid from movie"
Dim cmd As New SqlCommand(str, cnn)
Dim dr As SqlDataReader
cnn.Open()
dr = cmd.ExecuteReader

75
Name:-Ravi Singh
Roll No:-26

While dr.Read
DropDownList3.Items.Add(dr.Item(0))

End While
cnn.Close()
End Sub

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


Try
str = "update movie set name='" & TextBox2.Text & "',seat='" & TextBox3.Text & "',date='" &
Calendar1.SelectedDate & "',time='" & DropDownList1.SelectedValue & "',price='" & TextBox6.Text & "',class='" &
DropDownList2.SelectedValue & "' where mid='" & DropDownList3.SelectedValue & "'"

Dim cmd As New SqlCommand(str, cnn)


cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("movie updated")
Response.Redirect("show.aspx")
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
Output:-

Delete movie ticket page

76
Name:-Ravi Singh
Roll No:-26

Input:-

Delete.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="delete.aspx.vb" Inherits="delete" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
Select movie name which you want to delete
</p>
<p>
&nbsp;<asp:DropDownList ID="DropDownList1" runat="server" Height="34px"
Width="773px">
</asp:DropDownList>
<br />
</p>
<p>
<asp:Button ID="Button1" runat="server" BackColor="#66FF66" Height="46px"
Text="Delete" Width="367px" />
</p>
<p>
&nbsp;</p>
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [movie]"></asp:SqlDataSource>
</p>
<p>
</p>
</asp:Content>

77
Name:-Ravi Singh
Roll No:-26

Delete.aspx.vb

Imports System.Data.SqlClient
Partial Class delete
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
str = "select name from movie"
Dim cmd As New SqlCommand(str, cnn)
Dim dr As SqlDataReader
cnn.Open()
dr = cmd.ExecuteReader
While dr.Read
DropDownList1.Items.Add(dr.Item(0))

End While
cnn.Close()
End Sub

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


str = "delete from movie where name='" & DropDownList1.SelectedValue & "'"

Dim cmd As New SqlCommand(str, cnn)


cnn.Open()
str1 = cmd.ExecuteNonQuery
cnn.Close()
If str1 = True Then
MsgBox("data delete succesfully")
Response.Redirect("show.aspx")
End If
End Sub
End Class
Output:-

Search movie ticket page

78
Name:-Ravi Singh
Roll No:-26

Input:-

Search.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="search.aspx.vb" Inherits="search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
Search by movie name
<asp:TextBox ID="TextBox1" runat="server" Height="48px" Width="379px"></asp:TextBox>
&nbsp;<asp:Button ID="Button1" runat="server" BackColor="Lime" Height="33px"
Text="Search" Width="199px" />
<br />
</p>
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [movie]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" Width="746px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />

79
Name:-Ravi Singh
Roll No:-26

<SortedDescendingCellStyle BackColor="#FFFDF8" />


<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
</p>
</asp:Content>

Search.aspx.vb

Imports System.Data.SqlClient
Partial Class search
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
str = "select * from movie where name ='" & TextBox1.Text & "'"
Dim cmd As New SqlCommand(str, cnn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New Data.DataSet
cnn.Open()

da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
cnn.Close()
End Sub
End Class
Output:-

Show all movie ticket page

80
Name:-Ravi Singh
Roll No:-26

Input:-

Show.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/home.master" AutoEventWireup="false"


CodeFile="show.aspx.vb" Inherits="show" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<p>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [movie]"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" Width="776px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
<br />
</p>
<p>
</p>

81
Name:-Ravi Singh
Roll No:-26

</asp:Content>

Show.aspx.vb

Imports System.Data.SqlClient
Partial Class show
Inherits System.Web.UI.Page
Dim cnn As New SqlConnection("Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User
Instance=True")
Dim str, str1 As String

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


str = "select * from movie"
Dim cmd As New SqlCommand(str, cnn)
Dim da As New SqlDataAdapter(cmd)
Dim ds As New Data.DataSet
cnn.Open()

da.Fill(ds)
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
cnn.Close()

End Sub
End Class
Output:-

Registration data page

82
Name:-Ravi Singh
Roll No:-26

Movie data page

83

You might also like