MS的SQLHelper中如何得到存储过程的输出参数值

存储过程

create proc test4
@res varchar(10) output
as
select @res=count(*) from Ship_TUser_Info
go

cs文件:

SqlParameter[] paras = new SqlParameter[] { new SqlParameter("@res", SqlDbType.Int) };
         paras[0].Direction = ParameterDirection.Output;
         SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, "test4", paras);
         Response.Write(paras[0].Value.ToString());

posted @ 2012-05-10 16:23  szjdw  阅读(193)  评论(0编辑  收藏  举报