获取存储过程的返回值覆盖

2021-08-24 淮安装修公司

假设有存储过程如下:

CREATE proc sp_uptmp @tmpName varchar(50),@srcPos varchar(255)

as

Begin TRAN

insert into t_template values(@tmpName,@srcPos)

COMMIT

return isnull(@@identity,0)

GO

在里面获取返回值的方法为(c#):

SqlConnection dbconn = new SqlConnection(connStr);

SqlCommand cmd = new SqlCommand(\"sp_uptmp\",dbconn);

mandType = oredProcedure;

SqlParameter tmpName = d(\"@tmpName\",rChar);

SqlParameter srcPos = _d(\"@srcPos\",rChar);

SqlParameter rtnval = d(\"rval\",);

rection = put;

rection = put;

rection = turnValue;

lue = \"\";

lue = \"\";

en();

ecuteNonQuery();

ose();

tmpid = (int)lue; //此处即为返回值

5月份成绩出来 查看本文来源

营口治疗白癜风
西安男科医院排名
宝宝积食怎么调理脾胃
为你推荐