日期:2014-05-18  浏览次数:20703 次

如果要设定ExecuteNonQuery的值,在存取过程中要怎么做?
ado.net 执行 db.ExecuteNonQuery(dbCommand);后可以得到一个影响行数的值,我能不能直接在被调用的存取过程中设定这个值返回给 ado.net ?

------解决方案--------------------
返回给 ado.net 是什么意思? 你想让什么部分接收这个影响的行数?
------解决方案--------------------
探讨
asp.net 中 不是 这么写吗
int i= db.ExecuteNonQuery(dbCommand);

我想让i 得到的值, 是我在 存取过程中设定的

------解决方案--------------------
不能,用return parameter

参考:
Get return value from stored procedure
http://geekswithblogs.net/NewThingsILearned/archive/2008/09/17/get-return-value-from-stored-procedure.aspx