How are you going to instantiate an object when specifying a class name as a string in an ASP.NET v2 application? For example, I have a class called SystemLog defined in the app_code section of the application. The class is defined in the Reports namespace. To create an instance of an object, I do something like this:
Dim MyObject As New Global.Reports.SystemLog
However, I want to create this object using a string to determine the type. The type name is stored in the SQL database as a string. I think this is probably something related to Activator.CreateInstance (AssemblyName, TypeName), but I don't know what to pass on these lines. What is the assembly name of the ASP.NET web application?
Help!
Thanks Rob.
PS. I don't want a hard-coded Select statement :-)
source
share