>>>
public void TestOutputParams()
>>>{
>>> // Create the parameter and set the direction
>>> IDbDataParameter param1 = this.CreateParameter("@result", 0);
>>> param1.Direction = ParameterDirection.Output;
>>>
>>> // Call the stored procedure and pass the parameter
>>> IDbCommand cmd;
>>> this.ExecSprocScalar("OutputParamTest", out cmd, param1);
>>>
>>> // Retrieve the value from the command object
>>> IDbDataParameter param = (IDbDataParameter)cmd.Parameters["@result"];
>>> int x = (int)param.Value;
>>>}
>>
>>It looks to me as a bug in the Help file (incorrect Help). Search for a better example (and preferably using SQLParameter in the Help). That particular piece of code is wrong - (at least last 2 lines seem wrong to me - you already declared parameter - just get it).
>>
>>So, if you want to use that particular sample - comment out the extra declaration and use param1 instead of param at the end.
>
>Thanks,
>
>I've tried that and it didn't make a difference, I still just get 0 as the parameter value.
In the code above, where do you set cmd?
If it's not broken, fix it until it is.
My Blog