There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Can we have a Database.AddReturnParameter method please?
<p>It would be very handy if the Database had an AddReturnParameter(DbCommand cmd, string paramName, System.Data.DbType dbType, int size) method.</p> <p> </p> <p>This would act just like AddOutParameter, except it
would set the ParameterDirection to ReturnValue.</p> <p> </p> <p>Presently I seem to have to do the following which is a bit long winded, not very readable and requires parameters that are not relevant:</p> <p> </p>
<p>Database.AddParameter(cmd, "Return", System.Data.DbType.Int32, System.Data.ParameterDirection.ReturnValue, String.Empty, System.Data.DataRowVersion.Default, DBNull.Value);</p> <p> </p> <p>Seeing that
you can only have one return parameter it should also be possible to come up with a method to get the value:</p> <p>object Database.GetReturnValue(DbCommand cmd)</p>