473,378 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

DataType as class member

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

May 20 '06 #1
1 1164
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

"Bryan" <br*******@gmail.com> ???????/???????? ? ???????? ?????????:
news:11**********************@j33g2000cwa.googlegr oups.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

May 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Eternally | last post by:
Hi folks, I've got a program which has a function which uses templates to accept parameters of any type. Works well, but there's one certain datatype which I want to special case and do an...
4
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
9
by: Steve | last post by:
Hello (and a happy new year) I'm quite new to C++ and have to programm something for school and can't get my head around a couple of things, but at the moment this one is the most important for...
3
by: Adam Hartshorne | last post by:
Hi All, I have the following setup, and I was wondering what would be the best data type to achieve it. I have a class A, that stores a list of type X's and a list of type Y's. I also have a...
0
by: Omkar Singh | last post by:
hi, When I am serializing the array of following ParameterValueStruct class i didnot get 1> the type and size of array. 2> DataType of each element. It is especially needed in case of 'anyURI'...
5
by: kuvpatel | last post by:
Hi I want to refer a class called LogEvent, and use one of its methods called WriteMessage without actually having to create an instance of Logevent. I have tried using the word sealed with...
1
by: al | last post by:
hi, I have a table that contain a field "amount" its datatype is numeric(18,4) in sql server 2000 I have created a Datagrid, when I edit a record, I get an error like this one BC30456:...
14
by: Dave Booker | last post by:
It looks like the language is trying to prevent me from doing this sort of thing. Nevertheless, the following compiles, and I'd like to know why it doesn't work the way it should: public class...
0
by: =?Utf-8?B?VmFubmk=?= | last post by:
Hi all, I have the need to generate C# classes from XSD schemas, and the XSD.exe tool is just (almost) great for that. I said "almost" because it seems that every XML Schema datatype other than...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.