I am using entity model with a SQL DB, and I have a set of about 30 lookup tables which are in the same 3 column format, ID,Text,IsActive. But rather than create 30 forms I would like to create one form and depending on the string name of a type given, then populate a gridview and allow ability to Insert,Update or Delete records of that type.
I have tried
string objectType = "Namespace.Models.BenefitType";
object o = Assembly.GetExecutingAssembly().CreateInstance(objectType);
Type t = o.GetType();
but I can not access the type, I get a message about it being a type of System.Type not BenefitType.
Can someone advise me on how I can cast a type that is unknown until called dynamically.
Many Thanks