SubSonic Forums
All Your Database Are Belong To Us

SPROC parameters getting lost

Latest post 06-26-2008 2:46 PM by Eric Kemp. 2 replies.
  • 06-25-2008 6:36 PM

    • stref
    • Top 500 Contributor
    • Joined on 06-23-2008
    • Posts 8

    SPROC parameters getting lost

    I'm trying to execute an SPROC that takes 5 parameters and when I run it from the SubSonic wrapper I'm getting:

    System.Data.SqlClient.SqlException : Procedure or function 'SA_CurrentPricesForProduct' expects parameter '@WarehouseID', which was not supplied.

    When I debug the wrapper code (below) and inspect sp.Command.Parameters after each AddParameter() call below the count is always zero.

    My SubSonic sources are upto date as of this morning.

    Here is the wrapper:

    public static StoredProcedure SaCurrentPricesForProduct(int? WarehouseID, int? ProductID, int? CustomerID, int? ShipToOrganizationID, bool? OneLevePerPriceType, DateTime? RefDate)
    {
        SubSonic.StoredProcedure sp = new SubSonic.StoredProcedure("SA_CurrentPricesForProduct", DataService.GetInstance("Velocity"), "dbo");
        sp.Command.AddParameter("@WarehouseID", WarehouseID, DbType.Int32, 0, 10);
        sp.Command.AddParameter("@ProductID", ProductID, DbType.Int32, 0, 10);
        sp.Command.AddParameter("@CustomerID", CustomerID, DbType.Int32, 0, 10);
        sp.Command.AddParameter("@ShipToOrganizationID", ShipToOrganizationID, DbType.Int32, 0, 10);
        sp.Command.AddParameter("@OneLevePerPriceType", OneLevePerPriceType, DbType.Boolean, null, null);
        sp.Command.AddParameter("@RefDate", RefDate, DbType.DateTime, null, null);
        return sp;
    }

    Filed under:
  • 06-26-2008 10:31 AM In reply to

    Re: SPROC parameters getting lost

    Thanks for the report... I've tracked down the problem (which was introduced in one of the last few builds) and will have a fix in the repo in an hour or two...

    Would you mind opening up a Work Item for this so that we can track it?

    Found a bug? Help us fix it by submitting a Work Item!

  • 06-26-2008 2:46 PM In reply to

    Re: SPROC parameters getting lost

    Reply |Contact |Answer

    Fixed in Revision 465.

    Found a bug? Help us fix it by submitting a Work Item!

Page 1 of 1 (3 items) | RSS