0

i can handle a store procedure which returns one output parameter using ExecuteScalar()

but wot if my store procedure returns more than one parameter
then how can i handle it. any advice Adapost ?

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by dnanetwork
0

i think by following below code, we can retrieve value of more than one parameter. The code is for one parameter.

SqlParameter returnValueParam = cmd.Parameters.Add(@return,SqldbType.Int);
returnValue.Direction = ParameterDirection.ReturnValue;
cmd.ExecuteNonQuery();
int returnValue = (int) returnValueParam.Value;

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.