DataReaders, Stored Procedures and Output parameters
If you're running a stored procedure via
ExecuteReader and the stored procedure has some output parameters, you won't be able to access the values of the output parameters until you're done with the IDataReader. Thanks to
Bill Vaughn for an
MSDN article that cleared this up for me. See the section "
Using a DataReader to Process the RETURN Value and OUTPUT Parameters". Note how he calls the
DataReader's Close() method before accessing the output or return values.