DataType as class member

B

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
 
D

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top