c#(asp.net)接收存储过程返回值的方法
发布时间:2015-12-04 编辑:jiaochengji.com
在c#编程中,接收存储过程的返回值,会经常用到。因为基于执行效率的考虑,还是建议在c#编程中使用存储过程,代替复杂sql的编写,把工作量交给操作系统吧。
c#(asp.net)接收存储过程返回值的小例子,供大家参考。
复制代码 代码示例:
myparameter[2] = new SqlParameter("Ret", ""); //增加参数,赋予空值。
myparameter[2].Direction = ParameterDirection.ReturnValue; //设置状态为返回值
int value = SqlHelper.ExecuteNonQuery(SqlHelper.strConn, CommandType.StoredProcedure, "proc_Ustixian", myparameter);//执行sql
string sdatevalue = myparameter[2].Value.ToString();//获取存储过程中的返回值
myparameter[2].Direction = ParameterDirection.ReturnValue; //设置状态为返回值
int value = SqlHelper.ExecuteNonQuery(SqlHelper.strConn, CommandType.StoredProcedure, "proc_Ustixian", myparameter);//执行sql
string sdatevalue = myparameter[2].Value.ToString();//获取存储过程中的返回值
您可能感兴趣的文章:
c#(asp.net)接收存储过程返回值的方法
mysql存储过程与函数区别分析
asp.net调用存储过程详解
有关sql server 2008中存储过程的设计和实现
mysql存储过程实例教程
asp.net 获取存储过程返回值的方法
asp.net Session会话层使用与管理方法
Python MySQL callproc方法:调用数据库存储过程
C# 中调用 MySQL 存储过程的示例代码
使用 .NET的IO(4) Paul_Ni(原作)
[关闭]