707 ASP Assignment
707 ASP Assignment
[Link] a web page to demonstrate use of master page using themes, CSS.
Answer:
Design:
Output:
Output:
3. Create the application that accepts name, password, age, email id, and user id. All the information
entry is compulsory. Password should be reconfirmed. Age should be within 21 to 30. Email id should
be valid. User id should have at least a capital letter and digit as well as length should be between 7
and 20 characters.
Answer:
Design:
707-tybca 1
2 505 – Practical Assignment
Output:
- Create a web page to insert data with proper validation in above table and display data in gridview
control using coding.
Answer:
Design:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
707-tybca 2
3 505 – Practical Assignment
Try
[Link] = "insert into tblnews values('" & [Link] & "','" & [Link] & "')"
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
clearcontrols()
[Link]()
End Sub
Sub fillgrid()
Try
[Link] = "select * from tblnews"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Sub clearcontrols()
[Link] = ""
End Sub
Output:
Design:
Output:
- Create a Web page to display all the news details provide the update and delete facility on it.
Answer:
Design:
707-tybca 3
4 505 – Practical Assignment
Source:
Imports [Link]
Imports [Link]
Imports [Link]
Sub fillgrid()
Try
[Link] = "select * from tblnews"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Sub clearcontrols()
[Link] = ""
End Sub
707-tybca 4
5 505 – Practical Assignment
End Try
End Sub
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
End Class
Output:
Design:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
707-tybca 5
6 505 – Practical Assignment
Sub fillgrid()
Try
[Link] = "select * from tblnews1"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Protected Sub btnsearch_Click(ByVal sender As Object, ByVal e As [Link]) Handles [Link]
Dim sdate As String = [Link]
Try
[Link] = "select * from tblnews1 where newsdate = '" & sdate & "' "
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
searchfillgrid()
[Link] = sdate
[Link]()
End Sub
Sub searchfillgrid()
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
End Sub
End Class
Output:
- Create a web page that provide insert, update and delete functionality with proper validation.
Answer:
Design:
707-tybca 6
7 505 – Practical Assignment
Source:
Imports [Link]
Imports [Link]
Imports [Link]
Sub fillgrid()
Try
[Link] = "select * from tblemp order by deptid"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
clearcontrols()
[Link]()
End Sub
707-tybca 7
8 505 – Practical Assignment
Sub clearcontrols()
[Link] = ""
[Link] = ""
End Sub
Sub getdeptid()
Try
did = [Link] + 101
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
[Link] = "delete from tblemp where deptid = " & d_did & " and empname = '" & d_empname
& "' "
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
[Link]()
End Sub
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link] + 101
[Link] = "Update"
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
End Class
Output:
707-tybca 8
9 505 – Practical Assignment
Answer:
Design:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
Sub fillgrid()
Try
[Link] = "select * from tblemp order by deptid"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
End Try
End Sub
End Class
Output:
Design:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
707-tybca 9
10 505 – Practical Assignment
Sub fillgrid()
Try
[Link] = "select * from tblemp order by deptid"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
End Try
End Sub
End Class
Output:
Design:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
707-tybca 10
11 505 – Practical Assignment
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
End Try
End Sub
End Class
Output:
6. Create a Login page. After successfully login, page is redirect to home page, which displays
Username and logout option.
Answer:
707-tybca 11
12 505 – Practical Assignment
7. Create website using .net technology for online shopping of gifts. Give facility to register as admin
who can add various categories of gifts. The admin can also add, update or delete any gift articles on
the site. Users can register and view various gift articles and place orders using COD mode only.
Answer:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
Inherits [Link]
Dim da As SqlDataAdapter
Dim dt As DataTable
[Link] = Session("admin")
707-tybca 12
13 505 – Practical Assignment
Try
[Link] = constring
[Link] = con
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
img_main.Visible = False
End Sub
Sub fillgrid()
Try
[Link] = "select * from tblgiftmaster where admin='" & [Link] & "'"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Try
[Link]([Link]("~/images/") + [Link])
End If
[Link] = "insert into tblgiftmaster values('" & [Link] & "','" & [Link] & "','" &
[Link] & "','" & filepath & "')"
Else
[Link]([Link]("~/images/”) +[Link])
flag = True
If [Link](dimg) Then
[Link](dimg)
End If
img_main.Visible = False
End If
707-tybca 13
14 505 – Practical Assignment
If flag Then
[Link] = "update tblgiftmaster set gname='" & [Link] & "',gprice='" &
[Link] & "',filepath='" & filepath1 & "' where gid = " & [Link] & ""
Else
[Link] = "update tblgiftmaster set gname='" & [Link] & "',gprice='" &
[Link] & "' where gid = " & [Link] & ""
End If
End If
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
[Link]()
[Link] = ""
[Link] = ""
End Sub
Try
[Link] = [Link]
fillgrid()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Try
[Link] = "delete from tblgiftmaster where gid =" & gid & " "
[Link]()
[Link]()
If [Link](fileexists) Then
[Link](fileexists)
End If
Catch ex As Exception
[Link] = [Link]
End Try
707-tybca 14
15 505 – Practical Assignment
fillgrid()
[Link]()
End Sub
Try
img_main.Visible = True
g_admin=CType([Link]("lbl_admin"), Label)
[Link] = g_id.Text
[Link] = g_name.Text
[Link] = g_price.Text
img_main.ImageUrl = [Link]
Button_Main.Text = "Update"
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
End Class
OutPut:
Source of User:
Imports [Link]
Imports [Link]
Imports [Link]
Inherits [Link]
707-tybca 15
16 505 – Practical Assignment
Dim da As SqlDataAdapter
Dim dt As DataTable
[Link] = Session("User")
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
filldatalist()
End Sub
Sub filldatalist()
Try
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
End Try
End Sub
Try
g_admin=CType([Link]("lbl_admin"), Label)
[Link] = g_id.Text
[Link]("~/[Link]?gid=" & g_id.Text & "&gname=" & g_name.Text & "&gprice=" &
g_price.Text & "&admin=" & g_admin.Text & "&image=" & [Link])
Catch ex As Exception
End Try
End Sub
707-tybca 16
17 505 – Practical Assignment
Try
[Link] = [Link]
filldatalist()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
End Class
Product Design:
Source of Product:
Inherits [Link]
[Link] = [Link]("gid")
[Link] = [Link]("gname")
[Link] = [Link]("gprice")
[Link] = [Link]("admin")
[Link] = [Link]("image")
End Sub
[Link] = 0
[Link] = [Link]
End Sub
[Link] = -1
End Sub
707-tybca 17
18 505 – Practical Assignment
If [Link] Then
[Link] = ""
[Link]("~/[Link]")
Else
End If
End Sub
End Class
8. Create .NET based module that can be used for online missing person registration and processing
site where user can register and enter information about missing person. Create appropriate tables
and provide appropriate validations.
Answer:
Design:
Source:
Imports [Link]
Imports [Link]
Inherits [Link]
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
End Sub
Protected Sub Button1_Click (ByVal sender As Object, ByVal e As [Link]) Handles [Link]
707-tybca 18
19 505 – Practical Assignment
[Link]([Link]("~/images/") + [Link])
End If
If [Link] Then
gender = "Male"
End If
If [Link] Then
gender = "Female"
End If
Try
[Link] = "insert into tblmissingperson values('" & [Link] & "','" & [Link] & "'," &
[Link] & ",'" & gender & "','" & [Link] & "','" & [Link] & "','" &
[Link] & "','" & [Link] & "','" & filepath & "')"
[Link]()
[Link]()
Catch ex As Exception
End Try
[Link]()
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = False
[Link] = False
End Sub
End Class
9. Design module using [Link] "shoponline" for online shopping which provide online
shopping items like jeans shirts, shirt etc. It includes view of items along with their price.
Add selected items into cart and display shipping details. Provide proper validation.
Answer:
Source:
Imports [Link]
707-tybca 19
20 505 – Practical Assignment
Inherits [Link]
Dim data As DataTable = [Link]("select * from tblcart where uid = 1 and pid = " & productId & "")
Return
End If
End Sub
End Class
Dbhelper class:
Imports [Link]
Imports [Link]
Imports [Link]
Sub New()
[Link] = con
End Sub
[Link] = query
[Link]()
[Link]()
[Link]()
End Sub
[Link] = query
[Link]()
[Link](dt)
[Link]()
Return dt
End Function
707-tybca 20
21 505 – Practical Assignment
End Class
Source:
Imports [Link]
Inherits [Link]
[Link] = [Link](0).Item(1)
[Link] = [Link](0).Item(2)
[Link] = [Link](0).Item(4)
[Link] = [Link](0).Item(3)
End Sub
End Class
10. Design module using [Link] "online book shop" for online book shopping. User can view the
different category of books and place an order for book. Admin can manage the book stock. Provide
proper validation.
Answer:
Imports [Link]
Imports [Link]
Imports [Link]
Inherits [Link]
707-tybca 21
22 505 – Practical Assignment
Dim da As SqlDataAdapter
Dim dt As DataTable
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
fillgrid()
End Sub
Sub fillgrid()
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
End Sub
[Link]("~/[Link]?bid=" & [Link] & "&bname=" & [Link] & "&bprice=" & [Link]
& "&stock=" & [Link])
End Sub
End Class
Inherits [Link]
[Link] = [Link]("bid")
[Link] = [Link]("bname")
707-tybca 22
23 505 – Practical Assignment
[Link] = [Link]("bprice")
End Sub
[Link]("~/[Link]")
End Sub
End Class
Imports [Link]
Imports [Link]
Imports [Link]
Inherits [Link]
Dim da As SqlDataAdapter
Dim dt As DataTable
Try
[Link] = constring
[Link] = con
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
End Sub
Sub fillgrid()
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
End Sub
707-tybca 23
24 505 – Practical Assignment
Try
[Link] = "insert into tblbook values('" & [Link] & "','" & [Link] & "','" &
[Link] & "')"
Else
[Link] = "update tblbook set bname='" & [Link] & "',stock='" & [Link] &
"',bprice='" & [Link] & "' where bid = " & [Link] & ""
Button_main.Text = "Insert"
[Link] = ""
End If
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
[Link]()
clear()
End Sub
Sub clear()
[Link] = ""
[Link] = ""
[Link] = ""
End Sub
Try
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
[Link]()
End Sub
Try
707-tybca 24
25 505 – Practical Assignment
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
[Link] = [Link]
Button_main.Text = "Update"
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
End Class
11. Create interactive pages using .NET which accept Information pertaining to Airline booking. It
store information in the database using entry form and display information for given Booking-id. Use
following table for this purpose: Bookig master (booking_id, booking date, Name, address, contact_no,
Source_Place, Destination_Place). Provide appropriate validations.
Answer:
Design:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
Inherits [Link]
Dim da As SqlDataAdapter
Dim dt As DataTable
Try
[Link] = constring
[Link] = con
Catch ex As Exception
[Link] = [Link]
707-tybca 25
26 505 – Practical Assignment
End Try
End Sub
Try
[Link] = "insert into tblbooking values('" & [Link] & "','" & [Link] &
"','" & [Link] & "','" & [Link] & "','" & [Link] & "')"
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
[Link]()
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
End Sub
Try
[Link] = "select * from tblbooking where bid=" & [Link] & ""
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
End Try
End Sub
End Class
12. Create a website for Domino’s Pizza and give facility for ordering items. Maintain session for
logged in users.
Answer:
Design:
Source:
Imports [Link]
Imports [Link]
707-tybca 26
27 505 – Practical Assignment
Imports [Link]
Inherits [Link]
Dim da As SqlDataAdapter
Dim dt As DataTable
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
fillgrid()
End Sub
Sub fillgrid()
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
End Sub
Try
Catch ex As Exception
End Try
End Sub
End Class
707-tybca 27
28 505 – Practical Assignment
Inherits [Link]
[Link] = [Link]("photo")
[Link] = [Link]("price")
End Sub
[Link]("~/[Link]")
End Sub
End Class
13. Develop a .NET application for "E-Shopping system" will provide features like:
- Create appropriate database tables for this and provide appropriate validations.
Answer:
Source:
Imports [Link]
Imports [Link]
Imports [Link]
Inherits [Link]
Dim da As SqlDataAdapter
Dim dt As DataTable
707-tybca 28
29 505 – Practical Assignment
[Link] = Session("admin")
Try
[Link] = constring
[Link] = con
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
img_main.Visible = False
End Sub
Sub fillgrid()
Try
[Link] = "select * from tblgiftmaster where admin='" & [Link] & "'"
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Try
[Link]([Link]("~/images/") + [Link])
End If
[Link] = "insert into tblgiftmaster values('" & [Link] & "','" & [Link] & "','" &
[Link] & "','" & filepath & "')"
Else
[Link]([Link]("~/images/")+[Link])
flag = True
If [Link](dimg) Then
[Link](dimg)
707-tybca 29
30 505 – Practical Assignment
End If
img_main.Visible = False
End If
If flag Then
[Link] = "update tblgiftmaster set gname='" & [Link] & "',gprice='" &
[Link] & "',filepath='" & filepath1 & "' where gid = " & [Link] & ""
Else
[Link] = "update tblgiftmaster set gname='" & [Link] & "',gprice='" &
[Link] & "' where gid = " & [Link] & ""
End If
End If
[Link]()
[Link]()
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
[Link]()
[Link] = ""
[Link] = ""
End Sub
Try
[Link] = [Link]
fillgrid()
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
Try
[Link] = "delete from tblgiftmaster where gid=" & gid & " "
[Link]()
[Link]()
If [Link](fileexists) Then
[Link](fileexists)
End If
707-tybca 30
31 505 – Practical Assignment
Catch ex As Exception
[Link] = [Link]
End Try
fillgrid()
[Link]()
End Sub
Try
img_main.Visible = True
[Link] = g_id.Text
[Link] = g_name.Text
[Link] = g_price.Text
img_main.ImageUrl = [Link]
Button_Main.Text = "Update"
Catch ex As Exception
[Link] = [Link]
End Try
End Sub
End Class
Technician:
- Login
Registered user:
Answer:
707-tybca 31
32 505 – Practical Assignment
Imports [Link]
Imports [Link]
Inherits [Link]
Dim da As SqlDataAdapter
Dim dt As DataTable
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
fillgrid()
End Sub
Sub fillgrid()
da = New SqlDataAdapter(cmd)
dt = New DataTable
[Link](dt)
[Link] = dt
[Link]()
End Sub
Try
[Link] = [Link]
[Link] = True
End If
[Link] = True
End If
707-tybca 32
33 505 – Practical Assignment
[Link] = True
End If
[Link] = [Link]
[Link] = 0
End If
[Link] = 1
End If
Catch ex As Exception
End Try
End Sub
Try
[Link] = "update tblcomplaint set state='" & [Link] & "' where cid=" &
[Link] & ""
[Link]()
[Link]()
Catch ex As Exception
End Try
fillgrid()
[Link]()
[Link] = 0
[Link] = ""
[Link] = False
[Link] = False
[Link] = False
End Sub
End Class
Source:
Imports [Link]
Imports [Link]
Inherits [Link]
707-tybca 33
34 505 – Practical Assignment
If [Link] Then
com = [Link]
End If
If [Link] Then
com = [Link]
End If
If [Link] Then
com = [Link]
End If
Try
[Link] = "insert into tblcomplaint values('" & com & "','" & [Link] & "','" & s & "')"
[Link]()
[Link]()
Catch ex As Exception
End Try
[Link]()
[Link] = ""
[Link] = False
[Link] = False
[Link] = False
End Sub
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
End Sub
End Class
15. Develop the "Missing Person Information Management System" for police department by
Answer:
Design:
707-tybca 34
35 505 – Practical Assignment
Source:
Imports [Link]
Imports [Link]
Inherits [Link]
Try
[Link] = constring
[Link] = con
Catch ex As Exception
End Try
End Sub
[Link]([Link]("~/images/") + [Link])
End If
If [Link]
gender = "Male"
End If
If [Link] Then
gender = "Female"
End If
Try
[Link] = "insert into tblmissingperson values('" & [Link] & "','" & [Link] & "'," &
[Link] & ",'" & gender & "','" & [Link] & "','" & [Link] & "','" &
[Link] & "','" & [Link] & "','" & filepath & "')"
[Link]()
[Link]()
Catch ex As Exception
End Try
[Link]()
[Link] = ""
707-tybca 35
36 505 – Practical Assignment
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = ""
[Link] = False
[Link] = False
End Sub
End Class
16. Develop module using .NET to keep track of visitors in museum which stores visitor’s details like
name, time of visit, date of visit, contact no, etc. Also give facility to search and display visitor’s data
based on the date visited.
Answer:
Design:
Source:
Dbhelper class:
Imports [Link]
Imports [Link]
Imports [Link]
Sub New()
[Link] = con
End Sub
[Link] = query
[Link]()
[Link]()
[Link]()
End Sub
[Link] = query
[Link]()
707-tybca 36
37 505 – Practical Assignment
[Link](dt)
[Link]()
Return dt
End Function
End Class
Inherits [Link]
Dim insertQuery As String = "INSERT INTO VisitorRecords (Name, DateOfVisit, ContactNo, Email) " & _
"VALUES ('" & [Link] & "', '" & [Link]("yyyy-MM-dd") & "', '" & [Link] & "', '" &
[Link] & "')"
[Link](insertQuery)
End Sub
End Class
Source:
Inherits [Link]
[Link]()
End Sub
[Link]()
End Sub
End Class
707-tybca 37