I have the following sql stored procedure which I am trying to access the output parameter in my C# code.
ALTER PROCEDURE [dbo].[InsertCLR]
(
@JudgmentText nvarchar(MAX),
@JudgmentFormatted nvarchar(MAX),
@DateAdded date,
@JRId numeric OUTPUT
)
AS
SET NOCOUNT OFF;
INSERT INTO [dbo].[CLR.JudgmentReport] ([JudgmentText], [JudgmentFormatted], [DateAdded]) VALUES (@JudgmentText, @JudgmentFormatted, @DateAdded);
SELECT JudgmentText, JudgmentFormatted, DateAdded FROM [CLR.JudgmentReport] WHERE (JRId = SCOPE_IDENTITY())
SET @JRId = SCOPE_IDENTITY()
The following is the C# code which I am using trying to get the output parameter:
this.cLR_JudgmentReportTableAdapter.Insert(this.JudgmentC1Editor.Text, xmlDataIn, DateTime.Today.Date, out jrid);
It keeps telling me the output parameter variable should use the ref keyword. I need your help folks.