P
Phuff
My Delete and select commands work like a charm, but Update won't
work!! Can someone help??
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CellPadding="4"
DataSourceID="concept" ForeColor="#333333"
GridLines="None"
DataKeyNames="id,Description,unit,Quantity">
<FooterStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="Quantity"
HeaderText="Quantity" SortExpression="Quantity" />
<asp:BoundField DataField="unit"
HeaderText="unit" SortExpression="unit" />
<asp:BoundField DataField="Description"
HeaderText="Description" SortExpression="Description" />
<asp:CommandField ButtonType="Button"
ShowDeleteButton="True" />
<asp:BoundField DataField="id" HeaderText="id"
HtmlEncode="False" InsertVisible="False"
ReadOnly="True" ShowHeader="False"
SortExpression="id" />
<asp:CommandField ButtonType="Button"
ShowEditButton="True" />
</Columns>
<RowStyle BackColor="#FFFBD6" ForeColor="#333333"
/>
<SelectedRowStyle BackColor="#FFCC66"
Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="concept" runat="server"
ConnectionString="<%$ ConnectionStrings:Concept608ConnectionString %>"
SelectCommand="SELECT Quantity, unit, Description,
id FROM reportMatList WHERE (boxNumber = @boxNumber) AND (quoteNumber =
@quoteNumber) AND (unitNumber = @unitNumber)"
DeleteCommand="DELETE FROM reportMatList WHERE
(boxNumber = @boxNumber) AND (quoteNumber = @quoteNumber) AND
(unitNumber = @unitNumber) AND (id = @id)"
UpdateCommand="UPDATE reportMatList SET Quantity =
@Quantity, unit = @unit, Description = @Description WHERE id = @id">
<SelectParameters>
<asp:QueryStringParameter Name="boxNumber"
QueryStringField="txtBoxNumber" Type="String" />
<asp:QueryStringParameter Name="quoteNumber"
QueryStringField="txtQuoteNumber" Type="String" />
<asp:QueryStringParameter Name="unitNumber"
QueryStringField="txtUnitNumber" Type="String" />
</SelectParameters>
<DeleteParameters>
<asp:QueryStringParameter Name="boxNumber"
QueryStringField="txtBoxNumber" Type="String" />
<asp:QueryStringParameter Name="quoteNumber"
QueryStringField="txtQuoteNumber" Type="String" />
<asp:QueryStringParameter Name="unitNumber"
QueryStringField="txtUnitNumber" Type="String" />
<asp:ControlParameter Name="id"
ControlID="Gridview1" Type=Int32 />
</DeleteParameters>
<UpdateParameters>
<asp:ControlParameter Name="Quantity"
ControlID="Gridview1" Type=Int32 />
<asp:ControlParameter Name="unit"
ControlID="Gridview1" Type=string />
<asp:ControlParameter Name="Description"
ControlID="Gridview1" Type=string />
<asp:ControlParameter Name="id"
ControlID="Gridview1" Type=Int32 />
</UpdateParameters>
</asp:SqlDataSource>
work!! Can someone help??
<asp:GridView ID="GridView1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CellPadding="4"
DataSourceID="concept" ForeColor="#333333"
GridLines="None"
DataKeyNames="id,Description,unit,Quantity">
<FooterStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="Quantity"
HeaderText="Quantity" SortExpression="Quantity" />
<asp:BoundField DataField="unit"
HeaderText="unit" SortExpression="unit" />
<asp:BoundField DataField="Description"
HeaderText="Description" SortExpression="Description" />
<asp:CommandField ButtonType="Button"
ShowDeleteButton="True" />
<asp:BoundField DataField="id" HeaderText="id"
HtmlEncode="False" InsertVisible="False"
ReadOnly="True" ShowHeader="False"
SortExpression="id" />
<asp:CommandField ButtonType="Button"
ShowEditButton="True" />
</Columns>
<RowStyle BackColor="#FFFBD6" ForeColor="#333333"
/>
<SelectedRowStyle BackColor="#FFCC66"
Font-Bold="True" ForeColor="Navy" />
<PagerStyle BackColor="#FFCC66" ForeColor="#333333"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#990000" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="concept" runat="server"
ConnectionString="<%$ ConnectionStrings:Concept608ConnectionString %>"
SelectCommand="SELECT Quantity, unit, Description,
id FROM reportMatList WHERE (boxNumber = @boxNumber) AND (quoteNumber =
@quoteNumber) AND (unitNumber = @unitNumber)"
DeleteCommand="DELETE FROM reportMatList WHERE
(boxNumber = @boxNumber) AND (quoteNumber = @quoteNumber) AND
(unitNumber = @unitNumber) AND (id = @id)"
UpdateCommand="UPDATE reportMatList SET Quantity =
@Quantity, unit = @unit, Description = @Description WHERE id = @id">
<SelectParameters>
<asp:QueryStringParameter Name="boxNumber"
QueryStringField="txtBoxNumber" Type="String" />
<asp:QueryStringParameter Name="quoteNumber"
QueryStringField="txtQuoteNumber" Type="String" />
<asp:QueryStringParameter Name="unitNumber"
QueryStringField="txtUnitNumber" Type="String" />
</SelectParameters>
<DeleteParameters>
<asp:QueryStringParameter Name="boxNumber"
QueryStringField="txtBoxNumber" Type="String" />
<asp:QueryStringParameter Name="quoteNumber"
QueryStringField="txtQuoteNumber" Type="String" />
<asp:QueryStringParameter Name="unitNumber"
QueryStringField="txtUnitNumber" Type="String" />
<asp:ControlParameter Name="id"
ControlID="Gridview1" Type=Int32 />
</DeleteParameters>
<UpdateParameters>
<asp:ControlParameter Name="Quantity"
ControlID="Gridview1" Type=Int32 />
<asp:ControlParameter Name="unit"
ControlID="Gridview1" Type=string />
<asp:ControlParameter Name="Description"
ControlID="Gridview1" Type=string />
<asp:ControlParameter Name="id"
ControlID="Gridview1" Type=Int32 />
</UpdateParameters>
</asp:SqlDataSource>