Search code examples
subsonicsubsonic3

Subsonic 3 - how do you execute a stored procedure that returns a value?


How do you execute a stored procedure in subsonic 3.0 that returns a value? For example many of my stored procedures return @@identity, and I can't figure out how to access that value without re querying the table. Again, not an output parameter, but a return value.


Solution

  • StoredProcedure sproc = db.FancySchmancySproc();
    sproc.Execute();
    int output = (int)sproc.Output; // returns type 'object' so you'll need to cast