The stored procedure does not return and should not return anything by mistake

I have a stored procedure that we use to simply insert a new record into different tables. This Stored Procedure is configured to not return anything just for execution. When I pull it into my DBML, it sets it to "Void", which in my opinion is correct. Here is the auto generated code from DMBL.

[global::System.Data.Linq.Mapping.FunctionAttribute(Name="dbo.sp_PTS_Action_Insert_Comment")]
        public void sp_PTS_Action_Insert_Comment([global::System.Data.Linq.Mapping.ParameterAttribute(Name="Form_Name", DbType="VarChar(20)")] string form_Name, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Form_Number", DbType="VarChar(25)")] string form_Number, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="UID", DbType="VarChar(15)")] string uID, [global::System.Data.Linq.Mapping.ParameterAttribute(Name="Cmt", DbType="VarChar(200)")] string cmt)
        {
            this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), form_Name, form_Number, uID, cmt);
        }
    }

I call this SP as follows:

_context.sp_PTS_Action_Insert_Comment(formInformation["formType"], formInformation["formNumber"], userId, comment);

When this code executes this, it gives an error message

"System Void is not a valid return type for the displayed stored procedure"

My question is: can you use linq for a stored procedure with SP that specifically returns nothing? And if so, what am I doing wrong in this example?

+3
1

, , , Linq void, " ".

, SCOPE_IDENTITY() , .

, .

+1

All Articles