This is a migrated thread and some comments may be shown as answers.

Problems with sp has too many arguments

0 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 2
Robert asked on 03 Jul 2012, 03:36 PM
hi everybody
i have this error when i try to edit:

Procedure or function sp_c_comprasivamodificacion has too many arguments specified.

this is a simple sp for testing:

ALTER procedure [dbo].[sp_c_comprasivamodificacion]
 @fechaEmision as date, @id as int
AS

UPDATE       tbl_c_iva_compras
SET          fechaEmision = @fechaEmision where id=@id

and this is my my aspx:




 <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Sunset" GridLines="None"
        AllowPaging="True" PageSize="15" AllowSorting="True" AutoGenerateColumns="False"
        ShowStatusBar="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" EnableLinqExpressions="False" DataSourceID="SqlDataSource1"
                        Width="1155px">
        
      
<MasterTableView CommandItemDisplay="Top"
                   DataKeyNames="id,NoCorrelativo,fechaEmision"         DataSourceID="SqlDataSource1" EditMode="EditForms" PageSize="10" >
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
       <telerik:GridBoundColumn DataField="cod_pfiscal" visible="false"
            HeaderText="cod_pfiscal" SortExpression="cod_pfiscal"
            UniqueName="cod_pfiscal" DataType="System.Int32">
           <HeaderStyle Width="5px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="NoCorrelativo"
            HeaderText="No" SortExpression="NoCorrelativo"
            UniqueName="NoCorrelativo" DataType="System.Int32">
            <HeaderStyle Width="5px" />
        </telerik:GridBoundColumn>
    .
    .
    .
    .

        <telerik:GridEditCommandColumn CancelText="Cancelar" EditText="Editar"
            UpdateText="Modificar">
            <HeaderStyle Width="80px" />
            </telerik:GridEditCommandColumn>
    </Columns>
    <EditFormSettings  CaptionFormatString="Editar Factura: {0}" CaptionDataField="VGrLocales" EditFormType="Template" EditColumn-EditText="Editar" EditColumn-UpdateText="Modificar"  PopUpSettings-Modal="True">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
   
     <FormTemplate>
    
                    <br /><br />
                    <div class="_100">
                    <div class="_25">
                       <div class="_100">
                       <div class="_50">
                       <label>Fecha:</label>
                            
                             <telerik:RadDatePicker RangeMinDate="1940/05/01" MinDate="1940/01/01" ID="fecha_emision" Runat="server"  Skin="Default" DbSelectedDate='<%# Bind("fechaEmision") %>'
                            EnableEmbeddedBaseStylesheet="False" Width="100">
                            <DateInput EnableEmbeddedBaseStylesheet="False">
                            </DateInput>
                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False"
                         ViewSelectorText="x" EnableEmbeddedBaseStylesheet="False"></Calendar>
                        <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                        </telerik:RadDatePicker>
                       </div>
                       <div class="_50">
                       <label>Numero</label>
                       <asp:TextBox ID="TextBox4" Width="50" runat="server" Text='<%# Bind( "numeroDoc" ) %>' > </asp:TextBox></center><center>
                       
                       </div>
                    
                       </div>
                               
                      </div>
                      <div class="_25">
                      
                       <label>Proveedor:</label>
     
                      <telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="nombreProveedor" Skin="Simple"
                            DataValueField="nombreProveedor" DataSourceID="SqlDataSource2" SelectedValue='<%# Bind( "nombreProveedor") %>'  Width="210" Height="130">
                        </telerik:RadComboBox><br /><br />
                    
                      
                       </div>
                      <div class="_25">
                      <label>Gravadas:</label>
                            
                             <asp:TextBox ID="TextBox1" runat="server" MaxLength="10" Width="80" Text='<%# Bind( "CGInternas" ) %>'> </asp:TextBox>

                            
                       </div>
                       <div class="_25">
                       
                       <div class="_100">
                       <div class="_50">
                       
                                <asp:Button ID="Button1" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "AGREGAR", "MODIFICAR") %>'
                                    runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
                                </asp:Button>&nbsp;
                             
                           
                           </div>
                        <div class="_50">
              <asp:Button ID="Button2" Text="SALIR"  runat="server" CausesValidation="False" CommandName="Cancel" Width="100">
                                </asp:Button>
                               
                           </div>
                       
                       </div>
                       
                       
                       </div>
                       </div>
                           
                  
                </FormTemplate>




<PopUpSettings Modal="True" ZIndex="2500" Height="150px" Width="550px"></PopUpSettings>
    </EditFormSettings>
   
    <PagerStyle NextPageText="Siguiente" PrevPageText="Anterior" />
   
</MasterTableView>
        
         <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
         <ClientEvents OnPopUpShowing="PopUpCentered" />
        </ClientSettings>
    
                    </telerik:RadGrid>




 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="OverwriteChanges"
                        ConnectionString="<%$ ConnectionStrings:CONTASConnectionString %>"
                        SelectCommand="SELECT id, cod_pfiscal, NoCorrelativo, CONVERT (char(10), fechaEmision, 103) AS fechaEmision, cod_factura, numeroDoc, RTRIM(nrc) AS nrc, RTRIM(nombreProveedor) AS nombreProveedor, Total, FechaPago, FechaCancelado, CGInternas, CreditoFiscal, Retenc_13_SujetosNoDom, Retenc_13_SujetosExcl, Iva_Ant_a_Cta_Ret, Iva_Perc_2Tarjeta FROM tbl_c_iva_compras WHERE (cod_pfiscal = @cod_pfiscal) AND (tipodoc = 'CF') ORDER BY NoCorrelativo"
                                      
                        InsertCommand="sp_c_comprasiva"

       
                        InsertCommandType="StoredProcedure"
                        UpdateCommand="sp_c_comprasivamodificacion"
                        UpdateCommandType="StoredProcedure" >                                                                                  
                        <SelectParameters>
                            <asp:ControlParameter ControlID="cobperiodos" Name="cod_pfiscal"
                                PropertyName="SelectedValue" />
                        </SelectParameters>

                      
                        <UpdateParameters>
                            <asp:Parameter DbType="Date" Name="fechaEmision" />
                            <asp:Parameter Name="id" Type="Int32" />
                        </UpdateParameters>

                      
                        <InsertParameters>
      
                            <asp:Parameter Name="fechaEmision" />
                            <asp:Parameter Name="numeroDoc" />
                            <asp:Parameter Name="CGInternas" Type="Decimal" />
                            <asp:Parameter Name="nombreProveedor" />
      
                            <asp:ControlParameter ControlID="cobperiodos" Name="codpfiscal"
                                PropertyName="SelectedValue" />
                            <asp:sessionparameter Name="correlativo" sessionfield="correlativo" />
      
                            
                            <asp:ControlParameter ControlID="tipofactura" Name="tipo"
                                PropertyName="SelectedValue" />
                        </InsertParameters>
                     </asp:SqlDataSource>


i hope anyone can help me :(

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Robert
Top achievements
Rank 2
Share this question
or