locked
wrong number of parameters? RRS feed

  • Question

  • User1256512446 posted

    Hi all:

    I have an objectdatasource

        <asp:ObjectDataSource ID="objdsseguimientos" TypeName="comercial.seguimientos_administracion" SelectCountMethod="seleccionar_cuenta" EnablePaging="true" SelectMethod="seleccionar_todo" UpdateMethod="actualizar_todo" StartRowIndexParameterName="comienzo" MaximumRowsParameterName="maximonumeroregistros" SortParameterName="orden" runat="server" >
            <SelectParameters>
                <asp:Parameter Name="condicion" DefaultValue=" "  />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="pedido" />
                <asp:Parameter Name="obra"  />
            </UpdateParameters>
        </asp:ObjectDataSource>
    

    If I put only a parameter in updateparameters it works. But if I put two parameters it doesn't.

    What is wrong?

    TIA

    Sunday, August 16, 2015 9:41 AM

Answers

  • User533502567 posted

    If I put only a parameter in updateparameters it works. But if I put two parameters it doesn't.

    What is wrong?

    Any Error message? Following code should work..

      <UpdateParameters>
            <asp:Parameter Name="pedido" />
            <asp:Parameter Name="obra"  />
        </UpdateParameters>
    public void actualizar_todo(int pedido, string obra)
    {
     //update code
    }



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 16, 2015 10:01 AM
  • User61956409 posted

    Hi TIA,

    wrong number of parameters?

    If I put only a parameter in updateparameters it works. But if I put two parameters it doesn't.

    It seems that your UpdateMethod “actualizar_todo” takes only one argument. So it will throw exception if you pass two arguments to UpdateMethod. Please make sure if UpdateMethod accepts one argument.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 18, 2015 2:24 AM

All replies

  • User533502567 posted

    If I put only a parameter in updateparameters it works. But if I put two parameters it doesn't.

    What is wrong?

    Any Error message? Following code should work..

      <UpdateParameters>
            <asp:Parameter Name="pedido" />
            <asp:Parameter Name="obra"  />
        </UpdateParameters>
    public void actualizar_todo(int pedido, string obra)
    {
     //update code
    }



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, August 16, 2015 10:01 AM
  • User61956409 posted

    Hi TIA,

    wrong number of parameters?

    If I put only a parameter in updateparameters it works. But if I put two parameters it doesn't.

    It seems that your UpdateMethod “actualizar_todo” takes only one argument. So it will throw exception if you pass two arguments to UpdateMethod. Please make sure if UpdateMethod accepts one argument.

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 18, 2015 2:24 AM