title: How to get CType/DirectCast working with a defined variable instead of a direct type?
body: <p>I can't get the code below working.</p>
  
  <p>The error is in the last line: Type 'ChangeType' is not defined.</p>
  
  <p>Does the compiler thinks that ChangeType is a customtype which i did't have defiened ?</p>
  
  <p>I have no clue, plz give me a hint.
  May be I can't see the forest for the trees.</p>
  
  <pre><code>Dim DataValue as String = "True"
  Dim ChangeTypeIndex() As String = {"System.Boolean", "System.Char", "System.SByte", "System.Byte", "System.Int16"}
  Dim ChangeType As Type = Type.GetType(ChangeTypeIndex(0))
  Dim Result = DirectCast(DataValue, ChangeType)
  </code></pre>