how subsonic SP should return a value

Posted by android.sm on Stack Overflow See other posts from Stack Overflow or by android.sm
Published on 2010-05-29T02:00:17Z Indexed on 2010/05/29 2:02 UTC
Read the original article Hit count: 288

Filed under:

Hi all, I'm very much new to SubSonic and need a little guidance. Here, I want to know how my SP should return a value. Currently, when I execute it I simply pass an Int and it returns me a string value. Here is code:

SubSonic SP:

public static StoredProcedure GetQuote(int? CategoryId) { StoredProcedure sp = new StoredProcedure("GetQuote", DataService.GetInstance("Quotes Provider"), "dbo"); sp.Command.AddParameter("@CategoryId", CategoryId, DbType.Int32, 0, 10); return sp; }

My Code:

public bool GetQuote(int category, out string quote) { bool val = false; quote = ""; try { StoredProcedure sp = SPs.GetQuote(category); if (sp != null) { sp.Execute(); val = true; } } catch (Exception err) { throw err; } return val; }

Thanks all

© Stack Overflow or respective owner

Related posts about subsonic