Home All Groups Group Topic Archive Search About

DataType as class member

Author
20 May 2006 4:02 AM
Bryan
I have a class called "Prop".  I want that class to have a property
called "DataType" where the user can select and store a datatype.  How
can I store a DataType value in a class property.

how the code would work in my mind:

dim TempProp as new Prop
TempProp.DataType = String

Author
20 May 2006 12:45 PM
Dragon
You can use System.Type type and GetType operator for that purpose:

~
    TempProp.DataType = GetType(String)
~

But if you have a limited set of types you can allow, then you may
consider using an enum as well.

Roman

Show quoteHide quote
"Bryan" <bryanv***@gmail.com> ???????/???????? ? ???????? ?????????:
news:1148097720.943115.151590@j33g2000cwa.googlegroups.com...
> I have a class called "Prop".  I want that class to have a property
> called "DataType" where the user can select and store a datatype.  How
> can I store a DataType value in a class property.
>
> how the code would work in my mind:
>
> dim TempProp as new Prop
> TempProp.DataType = String
>