Hi
I am new to and getting used to LINQ. I have worked with SPROCS that return result sets. No problems there.
However I am having a problem with OUTPUT params & LINQ.
the stored procedure i simple enough
CREATE PROCEDURE [dbo].[PROCNAME]
-- Add the parameters for the
stored procedure here
@tcStageOccurrences smallint output
SELECT @tcStageOccurrences =
isnull(COUNT(*),0) from
Stage where Condition
I am calling this in C# as follows
System.Nullable<Int16> tcStageOccurences = null;
MyDb.ProcName(ref @tcStageOccurrences);
The value of @tcStageOccurrences is 0 whereas it should be >0
Questions
- I have always used SQLparam & ExcuteReader or ExecuteNonQuery without any problems. Since I am trying to do the same thing in LINQ, is there something I am missing out?
I know that i can and probably should be using a scalar function instead.
But in some cases there are multiple OUTPUT parameters that I need to access within C#
Any help or useful tips are most welcome :-)
Regards