I am trying to use a stored procedure that returns an int. Then I need to convert int to a boolean (success).
SqlParameter Return = new SqlParameter();
Return.ParameterName = "@return";
Return.SqlDbType = SqlDbType.Int;
Return.Direction = ParameterDirection.ReturnValue;
However this line of code throws a System.InvalidCastException
error
Success = (Boolean)Command.Parameters["@return"].Value;
What should I do to not get this error?
Thanks