StrataFrame Forum

Fill By Stored Procedure

http://forum.strataframe.net/Topic8697.aspx

By Tim Dol - 5/8/2007

I'm filling a business object based on a stored procedure that handles paging of data.  The business object is filled correctly but there is a section in the stored procedure to return the total record count, which is not related to the records count in the business object.

Example: I may have 100,000 records in the customer file but I am only requesting 1000 at a time. The stored procedure returnss the 1000 records into my business object and also return a total record count of 100,000 so I can display the page count.  How can I return this value to my business object when I call the stored procedure?

Thanks,

Tim

By Peter Jones - 5/8/2007

Hi,

I guess you could just use the BO's ExecuteScalar method to return the record cound.

Cheers, Peter

By StrataFrame Team - 5/9/2007

Does the stored procedure return the value as a second result set, or is it returned as an output parameter?  You could probably add a parameter to your stored procedure as an output parameter and set the value of that parameter to the record count.  After the stored procedure is executed, the SqlParameter will be filled with the value.