Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding properties dynamically
Message
From
15/04/2002 21:43:05
Rex Mahel
Realm Software, Llc
Ohio, United States
 
General information
Forum:
ASP.NET
Category:
Migration
Miscellaneous
Thread ID:
00643904
Message ID:
00645264
Views:
14
YAG,

Sorry to be so slow with this, but let me see if I understand. I need a collection of some sort, an array, an arraylist, or similar with 3 columns. One column is property name, another is property type and the third is property value. I'm guessing that the value column is the one you say should be of type object. I then use CTYPE to change the type going in to object and coming out to whatever type I need.

How am I doing?

Thanks

Rex

>Make the second column of type object. You will, however, have to cast the values when you use them...
>
>yag
>
>>YAG,
>>
>>The properties will be of different types. Can I set this up to allow different data type values?
>>
>>TIA
>>
>>Rex
>>
>>>>All,
>>>>
>>>>Is there any way in VB.Net to dynamically add properties to an object?
>>>>
>>>>TIA
>>>>
>>>>Rex
>>>
>>>Nothing inherent that I can think of. You can, however, create a 2-column array or collection where column 1 is your customer property name, and column 2 is your value. You can set up Set/Get so that your calling code looks something like this:
>>>
>>> form1.cprops("fred") = 5
>>> x = form1.cprops("fred")
>>>
>>>where cprops is your collection and "fred" is your parameter.
>>>
>>>yag
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform