c# or VB.net About casting an object into a datatype -


is there way able cast object depending on whats datatype written string after instanciating through relfection? example:

string datatype = "list<genericclassname>"; list<genericclassname> o = (datatype)dynamicallyinstantiateclass("namespace.classname"); 

of course can :

   dynamic d = activator.createinstance("assemblyname","typename");    d.dosomthing(); 

to find assembly name right click on projects own's class in application tab can find type assembly name


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

How can I fetch data from a web server in an android application? -

jquery - How can I dynamically add a browser tab? -