views:

289

answers:

2

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?

+1  A: 

You have to execute the stored procedure as a data set:

var stuffProcedure = db.UspSelectStuff(0, 1).GetDataSet();
John Rasch
+2  A: 

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

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