Hi,
Thanks a lot for all your replies. Those are really usefull.
One more thing i got to ask.
Once the object is created, it's type is System.Object.
Since i need to get all the functionaly of the specific type i'm creating, i
need to cast it to that particular type explicitly.
but.. coz i dont know what the 'exact type' is until the runtime, is there a
way to do it?
want to do it like this.
Type t = Type.GetType(typename);
MySpecificType o = (MySpecificType)Activator.CreateInstance(t);
Thanks,
Chamith
"Chamith" <ch********@gmail.com> wrote in message
news:#o**************@TK2MSFTNGP10.phx.gbl...
Hi all,
I have a method which takes a string parameter. It takes a type name as a
string.
Inside the method, i want to create an instance of the type which is
mentioned in the string parameter.
Please help me providing with some example code.
Thanks,
Chamith