R – How to get data from a SubSonic stored procedure

stored-proceduressubsonic

I have a stored procedure:

CREATE PROCEDURE [dbo].[usp_SelectStuff] AS

@param1 int
@param2 int

BEGIN

SELECT [Stuff] FROM TABLE

END

I want to run this from SubSonic, and the use the stuff that has been selected. So I do:

var db = DB.CreateDB();
var stuffProcedure = db.UspSelectStuff(0,1);

Now how do I actually get the data from here?

Best Answer

You can also load a collection and match properties will be populated:

ProductCollection coll = new ProductCollection();
coll.LoadAndCloseReader(db.UspSelectStuff(0, 1).GetReader());