I want create an instance of an object which accepts a Data Reader as a
constructor. I realize that I could create a gigantic case statement in
which I test for each text name, but that case statement would be rather
larger and I would have to revise as new classes are added or removed.
Another variable will tell me the namespace that I will find the class in.
So I would have a case statement which would evaluate the variable for
namespace, but what would the code look like to create a class for that text
name.
Example:
string classNm = "Account_Tb l";
switch (myNameSpaces)
{
case "GL.Tables"
Now I want to create and instance of "GL.Tables.Acco unt_Tbl" but
I want to
use the variable "classNm" to create the equivalent of the
statement below:
GL.Tables.Accou nt_Tbl = new GL.Tables.Accou nt(myDataReader );
break;
case "PACS.Table s"
Now I want to create and instance of "PACS.Tables.Ac count_Tbl"
but I want
to use the var "classNm" to create the equivalent of the
statement below:
PACS.Tables.Acc ount_Tbl = new PACS.Tables.Acc ount(myDataRead er);
break;