A
A_StClaire_
hi all,
I am using a GridView bound to an ObjectDataSource. edit and delete
functionality has been enabled. my ObjectDataSource is tied to a
TableAdapter that accesses three stored procedures - SPGetAllPrograms
(Select), SPDeleteProgram (Delete) and SPRetireProgram (Update).
deleting database records via clicking the GridView Delete button works
fine. as does the Select function.
however after clicking the Edit button and making changes to fields,
confirming the update by clicking 'Update' results in an exception:
"ObjectDataSource 'objDSGetAllPrograms' could not find a non-generic
method 'SPRetireProgram' that has parameters: targetRetired,
targetRetiredDate, original_programID, retired, retiredDate."
does anyone have any insight? I've attached the code for my GridView
as well as ObjectDataSource.
thx a million
<asp:GridView ID="gvRetireDelete" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="programID"
DataSourceID="objDSGetAllPrograms" ForeColor="#333333"
GridLines="None">
<FooterStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:BoundField DataField="programID"
HeaderText="programID"
InsertVisible="False" ReadOnly="True"
SortExpression="programID" />
<asp:BoundField DataField="programName"
HeaderText="programName" ReadOnly="True"
SortExpression="programName" />
<asp:BoundField DataField="departmentName"
HeaderText="departmentName"
ReadOnly="True" SortExpression="departmentName" />
<asp:BoundField DataField="description"
HeaderText="description" ReadOnly="True"
SortExpression="description" />
<asp:BoundField DataField="creationDate"
HeaderText="creationDate"
ReadOnly="True" SortExpression="creationDate" />
<asp:CheckBoxField DataField="retired" HeaderText="retired"
SortExpression="retired" />
<asp:BoundField DataField="retiredDate"
HeaderText="retiredDate"
SortExpression="retiredDate" />
<asp:CommandField ButtonType="Button" EditText="Retire"
InsertVisible="False"
ShowDeleteButton="True" ShowEditButton="True"
UpdateText="Confirm" />
</Columns>
<RowStyle BackColor="#E3EAEB" />
<EditRowStyle BackColor="#7C6F57" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True"
ForeColor="#333333" />
<PagerStyle BackColor="#666666" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="objDSGetAllPrograms" runat="server"
OldValuesParameterFormatString="original_{0}"
TypeName="dsMainTableAdapters.GetAllProgramsTableAdapter"
SelectMethod="SPGetAllPrograms"
DeleteMethod="SPDeleteProgram"
UpdateMethod="SPRetireProgram">
<DeleteParameters>
<asparameter Name="original_programID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="targetRetired" Type="Boolean" />
<asparameter Name="targetRetiredDate" Type="DateTime" />
<asparameter Name="original_programID" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
I am using a GridView bound to an ObjectDataSource. edit and delete
functionality has been enabled. my ObjectDataSource is tied to a
TableAdapter that accesses three stored procedures - SPGetAllPrograms
(Select), SPDeleteProgram (Delete) and SPRetireProgram (Update).
deleting database records via clicking the GridView Delete button works
fine. as does the Select function.
however after clicking the Edit button and making changes to fields,
confirming the update by clicking 'Update' results in an exception:
"ObjectDataSource 'objDSGetAllPrograms' could not find a non-generic
method 'SPRetireProgram' that has parameters: targetRetired,
targetRetiredDate, original_programID, retired, retiredDate."
does anyone have any insight? I've attached the code for my GridView
as well as ObjectDataSource.
thx a million
<asp:GridView ID="gvRetireDelete" runat="server" AllowPaging="True"
AllowSorting="True"
AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="programID"
DataSourceID="objDSGetAllPrograms" ForeColor="#333333"
GridLines="None">
<FooterStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<Columns>
<asp:BoundField DataField="programID"
HeaderText="programID"
InsertVisible="False" ReadOnly="True"
SortExpression="programID" />
<asp:BoundField DataField="programName"
HeaderText="programName" ReadOnly="True"
SortExpression="programName" />
<asp:BoundField DataField="departmentName"
HeaderText="departmentName"
ReadOnly="True" SortExpression="departmentName" />
<asp:BoundField DataField="description"
HeaderText="description" ReadOnly="True"
SortExpression="description" />
<asp:BoundField DataField="creationDate"
HeaderText="creationDate"
ReadOnly="True" SortExpression="creationDate" />
<asp:CheckBoxField DataField="retired" HeaderText="retired"
SortExpression="retired" />
<asp:BoundField DataField="retiredDate"
HeaderText="retiredDate"
SortExpression="retiredDate" />
<asp:CommandField ButtonType="Button" EditText="Retire"
InsertVisible="False"
ShowDeleteButton="True" ShowEditButton="True"
UpdateText="Confirm" />
</Columns>
<RowStyle BackColor="#E3EAEB" />
<EditRowStyle BackColor="#7C6F57" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True"
ForeColor="#333333" />
<PagerStyle BackColor="#666666" ForeColor="White"
HorizontalAlign="Center" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True"
ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:ObjectDataSource ID="objDSGetAllPrograms" runat="server"
OldValuesParameterFormatString="original_{0}"
TypeName="dsMainTableAdapters.GetAllProgramsTableAdapter"
SelectMethod="SPGetAllPrograms"
DeleteMethod="SPDeleteProgram"
UpdateMethod="SPRetireProgram">
<DeleteParameters>
<asparameter Name="original_programID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="targetRetired" Type="Boolean" />
<asparameter Name="targetRetiredDate" Type="DateTime" />
<asparameter Name="original_programID" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>