mercredi 20 mai 2015

instance with Activator not access the properties , reflection

I have a problem , I would like to make a generic method that instantiates the table of the model car , obviously by string .

I applied this code :

object item = Activator.CreateInstance(Type.GetType("eStartService." + tableName));

when I item.something , I do not see the properties of the table that should be called .

I ' the first time I use the reflection and maybe I'm doing something wrong ?

thanks





Aucun commentaire:

Enregistrer un commentaire