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

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

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

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -