<p>I would like to be able to cast a value dynamically where the type is known only at runtime. Something like this:</p>

<pre><code>myvalue = CType(value, "String, Integer or Boolean")
</code></pre>

<p>The string that contains the type value is passed as an argument and is also read from a database, and the value is stored as string in the database.</p>

<p>Is this possible?</p>

Sure, but
```
myvalue
```
will have to be defined as of type
```
Object
```
, and you don't necessarily want that. Perhaps this is a case better served by generics.
What determines what type will be used?