dhj Posted March 12, 2004 Posted March 12, 2004 hi all i need to create a C# class object in runtime (dynamically) my class name is in a string variable this is a web application developed in ASP.NET and C# if any body have an idea pls help thanks in advance Quote
Administrators PlausiblyDamp Posted March 12, 2004 Administrators Posted March 12, 2004 (edited) Quick example.... object o; o = Activator.CreateInstance(Type.GetType("System.DateTime")); however note that because I've declared the variable as object I have no access to the members of DateTime. Could you give a bit more detail on what you are trying to do as there may be a better / easier way. Edited March 29, 2007 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
dhj Posted March 12, 2004 Author Posted March 12, 2004 hi PlausiblyDamp thank you very much i have changed it according to my situation and now it's working fine thanks again Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.