I have a C# webform which uses a formview to insert, update, and delete records selected from a gridview into an Access database. The insert and delete functions work fine, the update does not.
UpdateCommand:
UpdateParameter s:
FormView Definition:
Update Button:
Any help is appreciated.
- The formview has 'id' as a DataKeyName.
- The update works if done from the Query Builder and I enter the values manually
- I don't have anything in the codebehind for the update event.
UpdateCommand:
Code:
UpdateCommand= "UPDATE CM_Codebase SET build_label = ? , program_type = ? , program_name = ? , ticket_status = ? , push_number = ? , approved = ? , comments = ? WHERE (id = ?)"
Code:
<UpdateParameters>
<asp:Parameter Name="build_label" />
<asp:Parameter Name="program_type" />
<asp:Parameter Name="program_name" />
<asp:Parameter Name="ticket_status" />
<asp:Parameter Name="push_number" />
<asp:Parameter Name="approved" />
<asp:Parameter Name="comments" />
<asp:Parameter Name="id" />
</UpdateParameters>
Code:
<asp:FormView ID="FormView1" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="id" DataMember="DefaultView" DataSourceID="AccessDataSource1" ForeColor="Black" HorizontalAlign="Center"> <FooterStyle BackColor="Tan" />
Code:
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update">
Comment