title: Creating a generic object based on a Type variable
body: <p>I need to create a generic object based on a type that is stored in a database. How can I acheive this? The code below (which won't compile) explains what I mean:</p>
  
  <pre><code>string typeString = GetTypeFromDatabase(key);
  Type objectType = Type.GetType(typeString);
  
  //This won't work, but you get the idea!
  MyObject&lt;objectType&gt; myobject = new MyObject&lt;objectType&gt;();
  </code></pre>
  
  <p>Is it possible to do this kind of thing?</p>
  
  <p>Thanks</p>