What I just wrote, is not good. In this case I have to=20
like objcollectie depends of the string whichobject. alse
>-----Original Message-----
>Hello,
>
>Thanks for the answer, but I still have a little problem.
>I did the following and it works :
>
>FieldInfo fld =3D typeof(DecisionTables).GetField
>("ObjectName");
>fld.SetValue(this.ObjectName ,objCollectie);
>
>
>Only this.ObjectName is not dynamical.
>
>Do I have to make an instance of it like this :
>newobj=3D System.Activator.CreateInstance(Type.GetType
>(strobjectname));
>
>and then=20
>
>fld.SetValue(newobj ,objCollectie);
>
>Why instantiate a new object of it? In my not dynamically=20
>example I did not instantiate the object:
> this.ObjectName =3D (ObjectName)objCollectie;
>
>Do i mis somethin essential here?
>
>Thanks for help,
>Nicky
>
>
>>-----Original Message-----
>>
>>> // I don't want this, I think first I have to search=20
>for=20
>>>a member in DecisionTables of the type ObjectName and=20
>then=20
>>>I will give it a reference. But also the parsing must=20
by=20
>>>dynamically (I have to do the parsing).
>>
>>You can get a FieldInfo reference representing the
>>DecisionTables.ObjectName field with typeof
>(DecisionTables).GetField()
>>or .GetFields(). You can then assign objCollectie to it=20
>with
>>FieldInfo.SetValue().
>>
>>
>>
>>Mattias
>>
>>--=20
>>Mattias Sj=F6gren [MVP] mattias @ mvps.org
>>
http://www.msjogren.net/dotnet/ >>Please reply only to the newsgroup.
>>.
>>
>.