<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="cart.aspx.vb" Inherits="cart" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:GridView ID="GridView1" runat="server" BackColor="White"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3"
ForeColor="Black" GridLines="Vertical"

style="z-index: 1; left: 293px; top: 711px; position: absolute; height: 184px; width: 985px"
AutoGenerateColumns="False" DataKeyNames="OrderID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="OrderID" HeaderText="OrderID" InsertVisible="False"
ReadOnly="True" SortExpression="OrderID" />
<asp:BoundField DataField="CusID" HeaderText="CusID" SortExpression="CusID" />
<asp:BoundField DataField="CusUsername" HeaderText="CusUsername"
SortExpression="CusUsername" />
<asp:BoundField DataField="ProductDesc" HeaderText="ProductDesc"
SortExpression="ProductDesc" />
<asp:BoundField DataField="TotalQuantity" HeaderText="TotalQuantity"
SortExpression="TotalQuantity" />
<asp:BoundField DataField="TotalPrice" HeaderText="TotalPrice"
SortExpression="TotalPrice" />
<asp:CommandField ButtonType="Button" SelectText="Delete"
ShowDeleteButton="True" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>
<asp:Panel ID="Panel1" runat="server" Height="196px">
</asp:Panel>
<p>
<asp:Label ID="lbltotal" runat="server" Text="Total:"></asp:Label>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:BookstoreConnectionString %>"
DeleteCommand="DELETE FROM OrderDetails WHERE (ProductDesc = @ProductDesc)"
SelectCommand="SELECT * FROM [OrderDetails]">
<DeleteParameters>
<asp:Parameter Type= "Int32" Name="ProductDesc" />
</DeleteParameters>
</asp:SqlDataSource>
</p>
<p>

</p>
</asp:Content>

Recommended Answers

All 3 Replies

how can you delete anything depend on Product Description..

i guess it should be ID... !

ooh
i changed the priductDesc to OrderID already, thx it works...

cool :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.