Using ExecuteReader I am able to return a DataReader
, but the out
parameter is returning 0.
Using ExecuteNonQuery I am able to retrieve the
To get the values from OUTPUT parameters with SqlDataReader you can only after the reader will be closed.
So you need to add this code before you try to get the values
if(!dataReader.IsClosed)
dataReader.Close();
if(out_recordCount.Value != DBNull.Value)
recordCount = Convert.ToInt64(out_recordCount.Value);
returnValue = Convert.ToInt32(return_Value.Value);