This does it:

public static ReportFactoryBase GetObject(string type)
{
  System.Reflection.Assembly reportImplementationAssembly =
System.Reflection.Assembly.GetExecutingAssembly();

  foreach (Type t in reportImplementationAssembly.GetTypes())
  {
 if (type == t.Name)
 {
  return (ReportFactoryBase) Activator.CreateInstance(t);
 }
  }

  throw new ApplicationException();
}

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to