title: I need a helper method to compare a char Enum and a char boxed to an object
body: <p>I have an enum that looks as follows:</p>
  
  <pre><code>public enum TransactionStatus { Open = 'O', Closed = 'C'};
  </code></pre>
  
  <p>and I'm pulling data from the database with a single character indicating - you guessed it - whether 'O' the transaction is open or 'C' the transaction is closed.</p>
  
  <p>now because the data comes out of the database as an object I am having a heck of a time writing comparison code.</p>
  
  <p>The best I can do is to write:</p>
  
  <pre><code>protected bool CharEnumEqualsCharObj(TransactionStatus enum_status, object obj_status) {
      return ((char)enum_status).ToString() == obj_status.ToString();
  }
  </code></pre>
  
  <p>However, this is not the only character enum that I have to deal with, I have 5 or 6 and writting the same method for them is annoying to say the least.  <a href="http://blogs.msdn.com/abhinaba/archive/2006/01/14/enumerting-all-values-of-an-enum.aspx" rel="nofollow noreferrer">Supposedly all enums inherit from System.Enum</a> but if I try to set that as the input type I get compilation errors.  This is also in .NET 1.1 so generics are out of the question.</p>
  
  <p>I've been struggling with this for a while. Does anyone have a better way of writing this method?  Also, can anyone clarify the whole enums inherit from System.Enum but are not polymorphic thing?</p>