> I think its possible with reflection, but not sure how...
Well we know for certain we have to create objects on the fly based off of a
type name specified in a database row... so right now we have the object
type... just need to create the object
>> Is it possible to create an object of a specific type just by knowing its
>> name as a text string?
[quoted text clipped - 10 lines]
> Regards,
> Phill W.
rowe_newsgroups - 18 Apr 2007 17:15 GMT
> Well we know for certain we have to create objects on the fly based off of a
> type name specified in a database row... so right now we have the object
[quoted text clipped - 14 lines]
> > Regards,
> > Phill W.
In addition to the others, if you are using serializable controls you
can store the searilized data into the database and then deserialize
the data back into the control. This way you don't have to worry about
setting all the properties.
Thanks,
Seth Rowe
Phill W. - 18 Apr 2007 17:18 GMT
> Well we know for certain we have to create objects on the fly based off of a
> type name specified in a database row... so right now we have the object
> type... just need to create the object
Ah ha!
That's one of the Good Reasons for doing this.
As Tom said, Type.GetType and Activator.CreateInstance.
This will work well for Framework-defined Types but watch out when you
start trying to use Types defined in /your own/ assemblies - whatever
process is doing all this has to be able to "get hold of" (i.e. Load)
the defining Assemblies. Can make for some fun deployment issues.
HTH,
Phill W.