| | | StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 3:00:39 PM Posts: 244, Visits: 816 |
| | How do I pass multiple parameters to the FillByStoredProcedure method? |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 3:24:00 PM Posts: 3,733, Visits: 3,926 |
| It is a ParamArray so you can just pass as many parms as you want or create an Object array....whichever works best for you:MyBo.FillByStoredProcedure(Parm1, Parm2, Parm3) or MyBo.FillByStoredProcedure(New Object() {Parm1, Parm2, Parm3)) |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 3:00:39 PM Posts: 244, Visits: 816 |
| | One of the data retrieval methods is MicroFour.StrataFrame.Business.BusinessLayer.FillByStoredProcedure(string, params System.Data.Common.DbParameter[]). How do I pass a parameters collection? Sorry, if I am not making myself clear. Here is the code offending code in my BO: public void FillByOrderIndex(int pPLType, int pOrderIndex) { FillByStoredProcedure("spx_GetOrderItemList", pPLType, pOrderIndex); } |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 3:24:00 PM Posts: 3,733, Visits: 3,926 |
| You have to supply a DbParameter. If you are using SQL Server, then it would look something like this:Me.FillByStoredProcedure("MyStoredSproc", New SqlParameter("@parm1", MyValue), New SqlParameter("@parm2", MySecondValue)) |
| | | | StrataFrame User
       
Group: StrataFrame Users Last Login: Yesterday @ 3:00:39 PM Posts: 244, Visits: 816 |
| | I did try this once: SqlParameter mPLType = new SqlParameter("@pltype", pPLType); SqlParameter mOrderIndex = new SqlParameter("@orderindex", pOrderIndex); FillByStoredProcedure("spx_GetOrderItemList", mPLType, mOrderIndex);It did not work...well, I didn't think it did. It's a good thing to set the DataSourceKey on the BO, too. It tends to misbehave when that is missing. Once I put that back in, then both your code and my code works just fine. Sorry for the oversight.  Thanks for helping! Bill |
| | | | 
StrataFrame Developer

Group: StrataFrame Developers Last Login: Yesterday @ 3:24:00 PM Posts: 3,733, Visits: 3,926 |
| No problem...glad you got it going |
| |
|
|