码迷,mamicode.com
首页 > Windows程序 > 详细

MVC C# 调用存储过程

时间:2016-07-13 21:25:54      阅读:728      评论:0      收藏:0      [点我收藏+]

标签:

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);

MVC C# 调用存储过程

标签:

原文地址:http://www.cnblogs.com/guess/p/5667277.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!