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;
}