sql output parameters are not returned until after all result sets have been
processed. add this loop after you have read your rows, then you can access
the output parameters:
while (reader.NextResult()) ;
-- bruce (sqlwork.com)
"Jim Heavey" <> wrote in message
news:CE5F748A-B9EF-4E50-AB71-...
>I have a SQL stored procedures which evaluate the values passed in
>parameters
> and then based on those values reads the appropriate records.
>
> I run the stored procedure in VS 2005 Debug mode and it successfully
> executes and I can see the @@ROWCOUNT has the expected number of rows.
>
> When I actually do this with my program, the datareader is returned with
> no
> execption, but no rows are found in the reader.
>
> So I change my Stored procedure to not even look at the parameter values
> being passed and just return rows. When I run this version of the stored
> procedure, I get plenty of rows returned.
>
> I change my stored procedure and create 2 output parameters so that I can
> echo back the parameter values which were received by the program. When I
> rerun the program, nothing is returned back in those parameters but a
> bunch
> of rows are returned.
>
> I have dumped the values of the parameters before the invoking the
> DataReader method and it looks good to me. What could possibly be wrong?
|