Link to home
Start Free TrialLog in
Avatar of Ed
EdFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Procedure or function has too many arguments specified

I keep getting the error. I just can find out why this is happening..



: Sys.WebForms.PageRequestManagerServerErrorException: Procedure or function Update_IV_Actions has too many arguments specified.


CREATE PROCEDURE [dbo].[Update_IV_Actions]
@IVRECORDID int,
@Actions_Completed int,
@Completed_Action nvarchar(max),
--@SignoffDate datetime,
@IV_Completed int


AS

UPDATE [I_IV_Actions]
SET [Actions_Completed] = @Actions_Completed
           ,[Completed_Action] = @Completed_Action
           ,[SignoffDate] = getdate()
           ,[IV_Completed] = @IV_Completed


WHERE IVRECORDID = @IVRECORDID

Open in new window


<asp:FormView ID="fvActionComp" runat="server" DataKeyNames="ID" DataSourceID="dsActionRecord" DefaultMode="Edit">
                              <EditItemTemplate>
                                  <br />

                                      <asp:TextBox ID="IVRecordIDTextBox" runat="server" Text='<%# Eval("IVRecordID")%>' />
                                  <table class="table table-hover table-condensed table-responsive">
                                      <tr>
                                          <td>DateAdded: </td>
                                          <td>
                                              <asp:TextBox ID="DateAddedTextBox" runat="server" ReadOnly="True" Text='<%# Eval("DateAdded")%>' />
                                          </td>
                                      </tr>
                                      <tr>
                                          <td>AddedBy:</td>
                                          <td>
                                              <asp:DropDownList ID="ddlIQAActionRaised" runat="server" AppendDataBoundItems="True" data-live-search="true" DataSourceID="DSListStaff" DataTextField="STAFFNAME" DataValueField="STAFFID" Enabled="False" SelectedValue='<%# Eval("AddedBy")%>'>
                                                  <asp:ListItem Value="0">-Select-</asp:ListItem>
                                              </asp:DropDownList>
                                          </td>
                                      </tr>
                                      <tr>
                                          <td>IV_Actioned: </td>
                                          <td>
                                              <asp:DropDownList ID="ddlIQAActionRaised0" runat="server" AppendDataBoundItems="True" data-live-search="true" DataSourceID="DSListStaff" DataTextField="STAFFNAME" DataValueField="STAFFID" Enabled="False" SelectedValue='<%# Eval("IV_Actioned")%>'>
                                                  <asp:ListItem Value="0">-Select-</asp:ListItem>
                                              </asp:DropDownList>
                                          </td>
                                      </tr>
                                      <tr>
                                          <td>Actions_Needed:</td>
                                          <td>&nbsp;</td>
                                      </tr>
                                      <tr>
                                          <td colspan="2">
                                              <asp:TextBox ID="Actions_CompletedTextBox" runat="server" Rows="5" Text='<%# Eval("Flagged_Action")%>' TextMode="MultiLine" Width="400px" Enabled="False" ReadOnly="True" />
                                          </td>
                                      </tr>
                                      <tr>
                                          <td class="auto-style3">Actions Satisfied?<asp:CheckBox ID="chkActionsSatisfied" runat="server" AutoPostBack="True" OnCheckedChanged="chkActionsSatisfied_CheckedChanged" Checked='<%# Bind("Actions_Completed")%>' />
                                          </td>
                                          <td class="auto-style3">&nbsp;</td>
                                      </tr>
                                  </table>
                               
                                  <table class="table table-hover table-condensed table-responsive" id="IVActionUpdate" runat="server" visible ="false">
                                      <tr>
                                          <td>IV Comments</td>
                                          <td>&nbsp;</td>
                                      </tr>
                                      <tr>
                                          <td colspan="2">
                                              <asp:TextBox ID="Actions_CompletedTextBox0" runat="server" Rows="5" Text='<%# Bind("Completed_Action")%>' TextMode="MultiLine" Width="400px" />
                                          </td>
                                      </tr>
                                      <tr>
                                          <td>IV Signoff Name</td>
                                          <td>
                                              <asp:DropDownList ID="ddlIQAActionClosedBy" runat="server" AppendDataBoundItems="True" data-live-search="true" DataSourceID="DSListStaff" DataTextField="STAFFNAME" DataValueField="STAFFID" SelectedValue='<%# Bind("IV_Completed")%>'>
                                                  <asp:ListItem Value="0">-Select-</asp:ListItem>
                                              </asp:DropDownList>
                                          </td>
                                      </tr>
                                      <tr>
                                          <td>&nbsp;</td>
                                          <td>
                                              <asp:Button ID="btnUpdateActions" runat="server" CommandName="Update" Text="SignOff"  />
                                          </td>
                                      </tr>
                                  </table>
                                  <br />
                                  &nbsp;<br />
                                  <br />
                                  &nbsp;<br />
                                  <br />
                                  &nbsp;<br /> &nbsp;&nbsp;
                              </EditItemTemplate>
                              <InsertItemTemplate>
                               <%--   IVRecordID:
                                  <asp:TextBox ID="IVRecordIDTextBox" runat="server" Text='<%# Bind("IVRecordID") %>' />
                                  <br />
                                  DateAdded:
                                  <asp:TextBox ID="DateAddedTextBox" runat="server" Text='<%# Bind("DateAdded") %>' />
                                  <br />
                                  AddedBy:
                                  <asp:TextBox ID="AddedByTextBox" runat="server" Text='<%# Bind("AddedBy") %>' />
                                  <br />
                                  IV_Actioned:
                                  <asp:TextBox ID="IV_ActionedTextBox" runat="server" Text='<%# Bind("IV_Actioned") %>' />
                                  <br />
                                  Actions_Completed:
                                  <asp:TextBox ID="Actions_CompletedTextBox" runat="server" Text='<%# Bind("Actions_Completed") %>' />
                                  <br />
                                  SignoffDate:
                                  <asp:TextBox ID="SignoffDateTextBox" runat="server" Text='<%# Bind("SignoffDate") %>' />
                                  <br />
                                  IV_Completed:
                                  <asp:TextBox ID="IV_CompletedTextBox" runat="server" Text='<%# Bind("IV_Completed") %>' />
                                  <br />
                                  <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
                                  &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />--%>
                              </InsertItemTemplate>
                              <ItemTemplate>
                            <%--      ID:
                                  <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                                  <br />
                                  IVRecordID:
                                  <asp:Label ID="IVRecordIDLabel" runat="server" Text='<%# Bind("IVRecordID") %>' />
                                  <br />
                                  DateAdded:
                                  <asp:Label ID="DateAddedLabel" runat="server"  />
                                  <br />
                                  AddedBy:
                                  <asp:Label ID="AddedByLabel" runat="server" Text='<%# Bind("AddedBy") %>' />
                                  <br />
                                  IV_Actioned:
                                  <asp:Label ID="IV_ActionedLabel" runat="server" Text='<%# Bind("IV_Actioned") %>' />
                                  <br />
                                  Actions_Completed:
                                  <asp:Label ID="Actions_CompletedLabel" runat="server" Text='<%# Bind("Actions_Completed") %>' />
                                  <br />
                                  SignoffDate:
                                  <asp:Label ID="SignoffDateLabel" runat="server" Text='<%# Bind("SignoffDate") %>' />
                                  <br />
                                  IV_Completed:
                                  <asp:Label ID="IV_CompletedLabel" runat="server" Text='<%# Bind("IV_Completed") %>' />--%>
                                  <br />
                              </ItemTemplate>
                          </asp:FormView>

Open in new window


Datasource

<asp:SqlDataSource ID="dsActionRecord" runat="server" ConnectionString="<%$ ConnectionStrings:IrisConnectionString %>" SelectCommand="GET_IV_Actions" SelectCommandType="StoredProcedure" UpdateCommand="Update_IV_Actions" UpdateCommandType="StoredProcedure">
                              <SelectParameters>
                                   <asp:SessionParameter Name="IVRECORDID" SessionField="IVRECORDID" Type="Int32" />
                              </SelectParameters>
                              <UpdateParameters>
                                    <asp:Parameter Name="IVRECORDID" Type="Int32" />
                               <asp:Parameter Name="Actions_Completed" Type="Int32" />
                         <asp:Parameter Name="Completed_Action" Type="String" />
                                         <asp:Parameter Name="IV_Completed" Type="Int32" />
                              </UpdateParameters>
                          </asp:SqlDataSource>

Open in new window

Avatar of Easwaran Paramasivam
Easwaran Paramasivam
Flag of India image

In EditItemTemplate I could see the parameters which are not in the dataset such as  Eval("DateAdded"), Eval("AddedBy") and so on. Have the fields in a way that parameters specified in SP, present in the EditItemTemplate fields.
ASKER CERTIFIED SOLUTION
Avatar of Ed
Ed
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ed

ASKER

I found the correction myself