close
// to associates a stored procedure which user defined in the database. // Must write it before func. [global::System.Data.Linq.Mapping.FunctionAttribute(Name ="stored procedure name")] // Undertake on a code, we make a func. let user to access the stored procedure. // When SP exist input variables, you must use "Linq.Mapping.ParameterAttribute" to // select the variable in DB and use "System.Nullable" to set // what variable you wnat to assign in code. public int storedProcedureForC#Class( [global::System.Data.Linq.Mapping.ParameterAttribute(Name:"inputVarName", DbType="inputVarType"] System.Nullable varInC#) { // Execute the stored procedure. IExecuteResult objectForSP = this.ExecuteMethodCall(this, ( (MethodInfo)(MethodInfo.GetCurrentMethod())), varInC#); return ((int)(result.ReturnValue)); }
全站熱搜