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 ?

Recommended Answers

All 2 Replies

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;

thnx rohand...i'll check and let u know...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.