Any "ReturnValue" parameter in Database Class?

Topics: Data Access Application Block
Sep 17, 2010 at 9:58 PM

I got some old stuff worked fine with Entlib 2.0, the SqlParameter has a "ReturnValue" like this:

SqlParameter[] parameters =


new SqlParameter( "ReturnValue", SqlDbType.Int, 4, ParameterDirection.ReturnValue, false, 0, 0,string.Empty, DataRowVersion.Default, null )

StoredProc like this:

select ... from table1

return @@error

and some SP has INPUT/OUTPUT parameters, I think the old 2.0's SqlHelper Class just take all param in, no matter IN/OUT, RETURN. The new Database Class takes IN & OUT param separately, so what's the match for "ReturnValue"?

Sep 20, 2010 at 1:37 AM

You can use the overload AddParameter of the Database object and specify ParameterDirection.ReturnValue as the parameter direction.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.