Professional Documents
Culture Documents
INTRODUCTION :-
More and more business houses are implementing web sites providing
commonplace.
where any kind of product can be bought from the comfort of home through the
Internet. However, for implementation purposes, this paper will deal with an
An online store is a virtual store on the Internet where customers can browse the
catalog and select products of interest. The selected items may be collected in a
shopping cart. At checkout time, the items in the shopping cart will be presented
transaction. Usually, the customer will be asked to fill select billing address, a
Page 1
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Page 2
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
PROJECT DESCRIPTION
Any member can register and view available products. Only registered member can
purchase multiple products regardless of quantity.
Visitor
User
Operator
Admin.
Operator can excess add option and can view everything of admin panel.
Operator can add product, edit product, update and remove product.Can access
users some information.
Operator can ship order to user based on order placed by sending confirmation
mail.
An Admin has some extra privilege including all privilege of visitor and user.
Admin can add products, edit product information and add/remove product.
Admin can add user, edit user information and can remove user.
Admin can ship order to user based on order placed by sending confirmation mail.
Page 3
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Sellers make websites where they display images of their products with price and
description. Shoppers who buy the products have multiple payment options like
COD, e-wallet, net banking, credit card, and so on.
Online sellers have the responsibility of shipping the product to the buyer and
ensuring safe and timely delivery.
B2C – Business to consumer; this refers to the sale of goods to the end-user
directly
Today with the high penetration of the internet and mobile devices – currently there
are about 776.45 million internet connections in India – it has also become very
easy to buy and sell online.
Page 4
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Page 5
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Database :-
Page 6
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Page 7
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Page 8
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
ADMIN SIDE:-
Admin.Master.aspx
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
Page 9
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Page 10
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
</div>
</div>
<div class="d-flex align-items-center">
<div class="ms-2">
</div>
</div>
<div class="d-flex align-items-center">
</div>
</div>
</div>
<div class="nav-item dropdown">
<div class="dropdown-menu dropdown-menu-end bg-light border-0 rounded-0 rounded-bottom m-0">
</div>
</div>
<div class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
<asp:Label runat="server" ID="adminlb" ></asp:Label>
</a>
<div class="dropdown-menu dropdown-menu-end bg-light border-0 rounded-0 rounded-bottom m-0">
<a href="#" class="dropdown-item">My Profile</a>
<a href="login.aspx" class="dropdown-item">Log Out</a>
</div>
</div>
</div>
</nav>
<!-- Navbar End ->
<!-- Admin Page -->
<div>
<asp:ContentPlaceHolder ID="mainBody" runat="server">
Page 11
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
</asp:ContentPlaceHolder>
</div>
<!-- Back to Top -->
<a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
</div>
Admin.aspx.vb
Imports System
Namespace WebApplication2
Public Partial Class Site1
Inherits System.Web.UI.MasterPage
Page 12
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Login Page</title>
<meta charset="utf-8">
<title>DASHMIN - Bootstrap Admin Template</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
Page 13
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
<h3>Sign In</h3>
</div>
<div class="form-floating mb-3">
<input type="email" class="form-control" id="txtusname" runat="server" placeholder="place@example.com"/>
<label >Email address</label>
</div>
<div class="form-floating mb-4">
<input type="password" class="form-control" id="txtpass" runat="server" placeholder="Password"/>
<label >Password</label>
</div>
<div class="d-flex align-items-center justify-content-between mb-4">
<asp:button type="submit" runat="server" class="btn btn-primary py-3 w-100 mb-4" Text="SIGN IN" ID="btnSubmit"
OnClick="btnSubmit_Click1"></asp:button>
Page 14
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
</div>
</div>
</div>
</div>
<!-- Sign In End -->
</div>
</html>
Description:-
A login screen is a web page or an entry page to a web application that requires user
identification and authentication, regularly performed by entering a username and password
combination. The login process is the most essential feature for any system/application as it
provides access to an entire web-site or part of it. So, testing of the login screen needs complete
coverage.
Login.aspx.vb
Imports System
Imports System.Data.SqlClient
Imports System.Configuration
Namespace WebApplication2.ADMIN
Public Partial Class login
Inherits System.Web.UI.Page
Page 15
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
If dr.Read() Then
Session("ADMIN") = dr(2).ToString()
Else
incorrect
")"c
End If
Response.Redirect("../admin/Dashboard.aspx")
Response.Write("<script>alert('Username & password are")
Catch ex As Exception
Response.Write(ex.Message)
Finally
End Try
End Sub
End Class
End Namespaceconn.Close();}}}}
DashBoard.aspx
Page 16
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
</asp:Content>
<asp:Content ID ="Content2" ContentPlaceHolderID="mainBody" runat="server">
</asp:Content>
Description:-
Successful online selling businesses need to optimize every stage of the customer journey, from first touch to
purchase. Ecommerce dashboards aggregate the most important performance metrics, so online sellers can track
their progress and quickly respond to any changes.
DashBoard.aspx.vb
Imports System.Data.SqlClient
Imports System.Configuration
Namespace WebApplication2
Inherits System.Web.UI.Page
conn.Open()
If dr.Read() Then
lbltotaluser.Text = dr(0).ToString()
End If
End If
End Sub
End Class
End Namespace
Page 17
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Categories.aspx
</div>
</div>
<asp:Button runat="server" class="btn btn-primary" Text="Submit" ID="txtsubmit" OnClick="txtsubmit_Click"/>
<asp:Button runat="server" CssClass=" btn btn-primary" Text="Update" ID="btnupdate" Visible="false"
OnClick="btnupdate_Click"/>
Page 18
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
</div>
</div>
</div>
</div>
<div class ="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<h5>CATEGORIES TABLE</h5>
<asp:GridView CssClass="table table-bordered" runat="server" ID="catgrid" AutoGenerateColumns="false"
AutoGenerateDeleteButton="True" OnRowDeleting="catgrid_RowDeleting" DataKeyNames="catid" OnRowEditing="catgrid_RowEditing"
AutoGenerateEditButton="true" Width="983px" >
<Columns>
<asp:BoundField DataField="catid" HeaderText="ID" />
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="des" HeaderText="Description" />
<asp:ImageField DataImageUrlField="image" HeaderText="Image" ItemStyle-HorizontalAlign="Center" ControlStyle-
Height="100" ControlStyle-Width="100"></asp:ImageField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>
Description:-
An ecommerce product page is a page on a website that defines a product and its features in its entirety.
This includes features like price, sizes, specs, colour, manufacturer and more
Categories.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration
Namespace WebApplication2.ADMIN
Page 19
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Inherits System.Web.UI.Page
filldata0()
End If
End Sub
Try
If Fileupload.HasFile Then
conn.Open()
Dim qur As String = "insert into tblcat values ('" & catname.Text & "','" + des.Text & "','" &
image & "') "
cmd.ExecuteNonQuery()
conn.Close()
Else
End If
filldata0()
Catch ex As Exception
Response.Write(ex)
End Try
End Sub
conn.Open()
Page 20
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
End If
Dim cmd As SqlCommand = New SqlCommand("select catid , name , des, image from tblcat",
conn)
sda.Fill(ds)
catgrid.DataSource = ds
catgrid.DataBind()
conn.Close()
End Sub
conn.Open()
End If
Dim qur As String = "Delete from tblcat where catid= " & e.Keys(0)
cmd.ExecuteNonQuery()
filldata0()
Catch ex As Exception
Response.AppendToLog(ex.ToString())
Finally
conn.Close()
End Try
End Sub
catgrid.EditIndex = -1
hdnid.Value = catgrid.DataKeys(e.NewEditIndex).Value.ToString()
Page 21
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
catname.Text = catgrid.Rows(e.NewEditIndex).Cells(2).Text
des.Text = catgrid.Rows(e.NewEditIndex).Cells(3).Text
btnupdate.Visible = True
txtsubmit.Visible = False
End Sub
conn.Open()
End If
Try
cmd.ExecuteNonQuery()
filldata0()
txtsubmit.Visible = True
btnupdate.Visible = False
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub
End Class
End Namespace
Page 22
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
subcategories.aspx
Page 23
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Description:-
To guide shoppers even further, you could then create subcategories, such as “Jeans” and “Khakis”
under the “Pants” category. Or, if you’re selling various brands of the same product, you could create
subcategories to highlight these differences.
Subcategories.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Data.SqlClient
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Configuration
Page 24
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Namespace WebApplication2.ADMIN
Public Partial Class subcategories
Inherits System.Web.UI.Page
Try
Dim cmd As SqlCommand = New SqlCommand("select * from tblsucat", conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
subcatgrid.DataSource = ds
subcatgrid.DataBind()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub
Page 25
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
If Fileupload.HasFile Then
Dim str As String = Fileupload.FileName
Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/subcatphoto/" & str))
Dim image As String = "../photo/subcatphoto/" & str.ToString()
conn.Open()
Dim qur As String = "insert into tblsucat values ('" &
ddlcatname.SelectedItem.ToString() & "','" + des.Text & "','" & image & "','" +
ddlcatname.SelectedValue & "') "
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
Else
Response.Write("<script>alert('Fill all the forms')</script>")
End If
fillgrid0()
Catch xe As Exception
Response.Write(xe)
End Try
End Sub
Page 26
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
End Namespace
Managebrand.aspx
Page 27
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
</div>
<div class="mb-3">
<asp:Label runat="server" Text="Description:"></asp:Label><br/>
<asp:TextBox runat="server" TextMode="MultiLine" ID="des" CssClass="form-control"
Rows="4"></asp:TextBox>
<div class="form-floating mb-3">
<asp:Label runat="server" Text="File Upload:"></asp:Label><br/>
<div class="mb-3">
<asp:FileUpload runat="server" ID="Fileupload" CssClass="form-control"/>
</div>
</div>
</div>
<asp:Button runat="server" ID="btnsubmit" class="btn btn-primary" Text="Submit"
OnClick="btnsubmit_Click"/>
</div>
</div>
</div>
</div>
<div class ="container-fluid pt-4 px-4">
<div class="row g-4">
<div class="col-lg-12">
<div class="bg-light rounded h-100 p-4">
<asp:GridView CssClass="table table-bordered" DataKeyNames="brandid" runat="server"
ID="brandgrid" AutoGenerateColumns="false" AutoGenerateDeleteButton="True" AutoGenerateEditButton="true"
OnRowDeleting="subcatgrid_RowDeleting" OnRowEditing="subcatgrid_RowEditing" Width="983px" >
<Columns>
<asp:BoundField DataField="brandid" HeaderText="ID" />
<asp:BoundField DataField="name" HeaderText="Name" />
<asp:BoundField DataField="des" HeaderText="Description" />
<asp:ImageField DataImageUrlField="logo" HeaderText="Image" ItemStyle-
HorizontalAlign="Center" ControlStyle-Height="100" ControlStyle-Width="100"></asp:ImageField>
</Columns>
</asp:GridView>
</div>
</div>
</div>
</div>
</asp:Content>
Description:-
Page 28
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
ManageBrand.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Data.SqlClient
Imports System.Data
Imports System.Web.UI.WebControls
Imports System.Configuration
Namespace WebApplication2.ADMIN
Public Partial Class managebrand
Inherits System.Web.UI.Page
Try
Dim cmd As SqlCommand = New SqlCommand("select * from tblbrand", conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
brandgrid.DataSource = ds
brandgrid.DataBind()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub
If Fileupload.HasFile Then
Page 29
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
fillgrid0()
Catch xe As Exception
Response.Write(xe)
End Try
End Sub
Page 30
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
ManageProducts.aspx
</div>
</div>
</div>
<asp:Button runat="server" class="btn btn-primary" Text="Submit" ID="btnsubmit"
OnClick="btnsubmit_Click1"/>
</div>
</div>
</div>
</div>
Description:-
Here we present a selection of product pages from retailers, with some examples of great design, use of
imagery, and some key features that make these pages more effective.
ManageProducts.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration
Namespace WebApplication2.ADMIN
Public Partial Class manageproduct
Inherits System.Web.UI.Page
Page 33
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
(SELECT name FROM tblcat WHERE tblcat.catid=tblpro.catid) AS cat, (SELECT name FROM tblsucat
WHERE tblsucat.subcatid=tblpro.subcatid) AS sub, (SELECT name FROM tblbrand WHERE
tblbrand.brandid=tblpro.brandid) AS brand from tblpro", conn)
Dim sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
sda.Fill(ds)
productgrid.DataSource = ds
productgrid.DataBind()
conn.Close()
End Sub
If Fileupload.HasFile Then
Dim str As String = Fileupload.FileName
Fileupload.PostedFile.SaveAs(Server.MapPath("../photo/productphoto/" & str))
Dim image As String = "../photo/productphoto/" & str.ToString()
conn.Open()
Dim qur As String = "insert into tblpro values ('" & proname.Text & "','" + des.Text & "'," +
price.Text & "," + quantity.Text & ",'" & image & "','" + subcat.SelectedValue & "','" +
brand.SelectedValue & "','" + category.SelectedValue & "')"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
Response.Write(cmd.ExecuteNonQuery())
conn.Close()
Else
Response.Write("<script>alert('Fill all the forms')</script>")
End If
filldata0()
Catch ex As Exception
Response.Write(ex)
End Try
End Sub
End Class
End Namespace
Page 35
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
ViewUser.aspx
Page 36
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Description:-
The User Record page is organized into sections. The E-Commerce Information section contains a user 's
override amount and value added id number. The availability of this section is controlled by backend settings.
ViewUser.aspx.vb
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Namespace WebApplication2.ADMIN
Public Partial Class viewuser
Inherits System.Web.UI.Page
Try
Dim cmd As SqlCommand = New SqlCommand("select * from tbluser", conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
usergrid.DataSource = ds
usergrid.DataBind()
Catch ex As Exception
Page 37
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub
Page 38
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
CLIENT SIDE
UserLogin.aspx
Description:-
We can define a login page as the web page or entry page to a site where the user requires authentication to access it. They
use identification credentials that include a username and password.
UserLogin.aspx.vb
Imports System
Imports System.Data.SqlClient
Imports System.Configuration
Namespace WebApplication2.User
Public Partial Class UserLogin
Inherits System.Web.UI.Page
Page 39
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Try
conn.Open()
Dim qur As String = "select * from tbluser where usermail ='" & txtemail.Text & "' and"
userpass = """"c
";"
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.Read() Then
Session("User") = dr(1).ToString()
Session("Userid") = dr(0).ToString()
Else
Response.Redirect("../User/Homepage.aspx")
Response.Write("<script>alert('Username & password are", incorrect, ")"c)
End If
Catch ex As Exception
Response.Write(ex.Message)
Finally
conn.Close()
End Try
End Sub
End Class
End Namespace
Page 40
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Register.aspx
Description:-
We can define a Registration page as the web page or entry page to a site where the user requires fill form those user visit
first time in website.
Page 41
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Register.aspx.vb
Imports System
Imports System.Configuration
Imports System.Data.SqlClient
Namespace WebApplication2.User
Public Partial Class register
Inherits System.Web.UI.Page
Page 42
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
HOMEPAGE
Description:-
This is home page from user side.and it’s show main product with different type of categories.
HomePage.aspx.vb
Imports System
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Data
Namespace WebApplication2.User
Public Partial Class Homepage
Inherits System.Web.UI.Page
Page 43
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
End Sub
Products.aspx
Page 44
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Description:-
This page show diferent type of product with different categories.
Products.aspx.vb
Imports System
Imports System.Web.UI.WebControls
Imports System.Data.SqlClient
Imports System.Data
Imports System.Configuration
Namespace WebApplication2.User
Public Partial Class products
Inherits System.Web.UI.Page
showProduct(productid)
loadData("tblpro", dlProducts)
productid = If(Request.QueryString("productid") IsNot Nothing, Request.QueryString("productid"),
"")
subcatid = If(Request.QueryString("subcatid") IsNot Nothing, Request.QueryString("subcatid"), "")
End Sub
Page 45
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Try
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim pid As Integer = Convert.ToInt32(productid.ToString())
Dim qty As Integer = Convert.ToInt32((TryCast(dlProduct.Items(0).FindControl("ddlQty"),
DropDownList)).SelectedValue)
Dim total As Integer = 0
Dim price As Integer = 0
Dim name As String = ""
Dim image As String = ""
If True Then
Dim q As String = "SELECT * FROM tblpro WHERE productid=" & pid
Dim c As SqlCommand = New SqlCommand(q, conn)
Dim dr As SqlDataReader = c.ExecuteReader()
If dr.Read() Then
price = Convert.ToInt32(dr(3).ToString())
image = dr(5).ToString()
name = dr(1).ToString()
End If
Page 46
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Try
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim pid As Integer = Convert.ToInt32(productid.ToString())
Dim qty As Integer = Convert.ToInt32((TryCast(dlProduct.Items(0).FindControl("ddlQty"),
DropDownList)).SelectedValue)
Dim total As Integer = 0
Dim price As Integer = 0
Dim name As String = ""
Dim image As String = ""
If True Then
Dim q As String = "SELECT * FROM tblpro WHERE productid=" & pid
Dim c As SqlCommand = New SqlCommand(q, conn)
Dim dr As SqlDataReader = c.ExecuteReader()
If dr.Read() Then
price = Convert.ToInt32(dr(3).ToString())
image = dr(5).ToString()
name = dr(1).ToString()
End If
Page 47
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
End Class
End Namespace
Cart.aspx
Description:-
When user are buy some product so that product are show in cart section other wise cart section is empty.
Cart.aspx.vb
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Namespace WebApplication2.User
Public Partial Class cart
Inherits System.Web.UI.Page
Page 48
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
End If
End Sub
Try
conn.Open()
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim total As Integer = 0
Dim q As String = "select SUM(totalcost) from cart where userid =" & userid
Dim cmd As SqlCommand = New SqlCommand(q, conn)
Dim dr As SqlDataReader = cmd.ExecuteReader()
If dr.Read() Then
total = Convert.ToInt32(dr(0).ToString())
End If
lbltotal.Text = total.ToString()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub
Try
conn.Open()
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Dim q As String = "select * from cart where userid =" & userid
Dim cmd As SqlCommand = New SqlCommand(q, conn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim ds As DataSet = New DataSet()
da.Fill(ds)
cartgrid.DataSource = ds
cartgrid.DataBind()
Catch ex As Exception
Response.Write(ex)
Finally
conn.Close()
End Try
End Sub
Page 49
Name :-RAMANI ANSH K.
Roll No:- 280
Division:- TYBCA-D
Try
Finally
End Try
conn.Open()
Dim qur As String = "delete from cart where cardproid=" & e.Keys(0)
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
fillgrid()
total()
Try
Catch ex As Exception
Response.Write("<script>alert('You can't delete the product')</script>")
Response.AppendToLog(ex.ToString())
Finally
conn.Close()
End Try
End Sub
Protected Sub btncheck_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
conn.Open()
Dim userid As Integer = Convert.ToInt32(Session("Userid"))
Response.Write(userid)
Dim qur As String = "delete from cart where userid=" & userid
Dim cmd As SqlCommand = New SqlCommand(qur, conn)
cmd.ExecuteNonQuery()
conn.Close()
successmsg.Text = "Order Successful ✔ Thank You For Shoping"
fillgrid()
total()
Catch ex As Exception
Response.Write("<script>alert('You can't delete the product')</script>")
Response.AppendToLog(ex.ToString())
Finally
conn.Close()
End Try
End Sub
End Class
End Namespace
Reference of website :-
https://www.github.com/
https://www.javatpoint.com/asp-net-tutorial
https://www.w3schools.com/asp/webpages_database.asp
Page 50