MVC C# 调用存储过程

SqlParameter[] param ={
new SqlParameter("@SignInfoId ",SqlDbType.Int),
new SqlParameter("@sign_opinion ",SqlDbType.VarChar,50),
new SqlParameter("@accountNo ",SqlDbType.VarChar,50),
new SqlParameter("@sign_bill_no ",SqlDbType.VarChar,50),
new SqlParameter("@agent_bill_type_id ",SqlDbType.Int),
new SqlParameter("@parms ",SqlDbType.VarChar,500),
new SqlParameter("@isOk ",SqlDbType.Bit)
};
param[0].Value = SignInfoId;
param[1].Value = sign_opinion;
param[2].Value = emp_no;
param[3].Value = sign_bill_no;
param[4].Value = agent_bill_type_id;
param[5].Value = parms;
param[6].Direction = ParameterDirection.Output;(返回的参数)
var results = context.Database.ExecuteSqlCommand("Create_Sign_Info @SignInfoId,@sign_opinion ,@accountNo ,@sign_bill_no,@agent_bill_type_id,@parms,@isOk out",
param[0], param[1], param[2], param[3], param[4], param[5], param[6]);
return Convert.ToBoolean(param[6].Value);

posted @ 2016-07-13 16:12  华家宝贝冬冬  阅读(514)  评论(0编辑  收藏  举报