Hi,
In C#, is it possible to obtain an object reference from a string
representation of the object's name?
for example, if I have a TableName = "TblName", and the dataAdapter
associated with that table is called "daTblName", however, I will not know
the TableName till run time.
so at run time, the user will have 20 tablenames to choose from on a page,
and I will pass the chosen table name as a QueryString
(Table.aspx?tablename="TblName"), so I don't have a reference to the data
adapter referring to this particular table, but I know the data adapter's
name.
Is it possible, knowing that the data adapter's object name, to get a
reference to it at run time, perhaps by using Reflection?
Thanks,
CB
Code Blue - 30 Apr 2005 10:30 GMT
Ok, I think that using Remoting or Reflection is overkill here, if not
impossible. I guess the best way is to use a hashtable to associate the
tables with their data adapters.
however, I am a little surprised that no simple method exists to do this.
CB
> Hi,
>
[quoted text clipped - 17 lines]
>
> CB