When i try to update the row in datagridview, it doesn't get updated into database. Nothing happens when i change the fields. Not even the delete command is working.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="existBill2.aspx.cs" Inherits="existBill2" %>
<!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>Editing Existing Bill</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Image ID="Image1" runat="server" Height="102px"
ImageUrl="~/images/21stcy.jpg" Width="1003px" />
</div>
<div>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource2" DataTextField="billNo" DataValueField="billNo">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:21centuryConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:21centuryConnectionString1.ProviderName %>"
SelectCommand="select billNo from tbl_bill"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" AutoGenerateEditButton="true" AutoGenerateDeleteButton="true" DataKeyNames="item_id">
<Columns>
<asp:BoundField DataField="item_id" HeaderText="item_id"
SortExpression="item_id" />
<asp:BoundField DataField="art_no" HeaderText="art_no"
SortExpression="art_no" />
<asp:BoundField DataField="item_color" HeaderText="item_color"
SortExpression="item_color" />
<asp:BoundField DataField="item_size" HeaderText="item_size"
SortExpression="item_size" />
<asp:BoundField DataField="item_category" HeaderText="item_category"
SortExpression="item_category" />
<asp:BoundField DataField="item_price" HeaderText="item_price"
SortExpression="item_price" />
<asp:BoundField DataField="item_quantity" HeaderText="item_quantity"
SortExpression="item_quantity" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:21centuryConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:21centuryConnectionString1.ProviderName %>"
SelectCommand="SELECT item_id, art_no, item_color, item_size, item_category, item_price, item_quantity from tbl_items where billNo=?bill_no"
UpdateCommand="Update tbl_items set art_no=@artNo, item_color=@iColor, item_size=@iSize, item_category=@iCategory, item_price=@iPrice, item_quantity=@iQuantity where item_id=@itemID"
DeleteCommand="DELETE FROM tbl_items WHERE item_id=@itemID" >
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" PropertyName="SelectedValue" Name="bill_no" Type="Int32" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="artNo" Type="String" />
<asp:Parameter Name="iColor" Type="String" />
<asp:Parameter Name="iCategory" Type="String" />
<asp:Parameter Name="iPrice" Type="Int32" />
<asp:Parameter Name="iSize" Type="Int32" />
<asp:Parameter Name="iQuantity" Type="Int32" />
<asp:Parameter Name="itemID" Type="Int32" />
</UpdateParameters>
<DeleteParameters>
<asp:Parameter Name="itemID" Type="Int32" />
</DeleteParameters>
</asp:SqlDataSource>
</div>
</form>
</body>
</html>