title: Dynamic field type handling
body: <p>I have to do an export from DB to CSV. (<strong>.NET 2</strong>)</p>
  
  <pre><code>field; fileld; field... etc
  </code></pre>
  
  <p>Have 3 types of fields: <strong>Alpha</strong>, <strong>Numeric</strong> and <strong>Bool</strong> respresented as <code>"alphaValue"</code>,<code>intValue</code> and <code>True/False</code>.</p>
  
  <p>I try to encapsulate this in a <strong><em>fields collection</em></strong>, in order to export if alpha then set "", if Bool=>True/False if numeric let as is.</p>
  
  <p>and try to build a <code>CsvField</code> class:</p>
  
  <pre><code>  Public Structure?Class CsvField(Of T As ???)
  
    End Structure
  
    Enum FieldType
      Alpha
      Bool
      Numeric
    End Enum
  </code></pre>
  
  <p>possibile usage:</p>
  
  <pre><code>myCollection.Add(new CsvField(DateTime.Now, FileType.Alpha))
  myCollection.Add(new CsvField(myInt, FileType.Numeric))
  </code></pre>
  
  <p>any suggestions welcomed.</p>