tags:

views:

22

answers:

0

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