TypeCode Enumeration
Specifies the type of an object.
[Visual Basic] <Serializable> Public Enum TypeCode [C#] [Serializable] public enum TypeCode [C++] [Serializable] __value public enum TypeCode [JScript] public Serializable enum TypeCode
Remarks
Call the GetTypeCode method on classes that implement the IConvertible interface to obtain the type code for an instance of that class.
Otherwise, call an object's GetType method to obtain its Type object, then call the Type object's GetTypeCode method to obtain the object's type code.
Members
| Member name | Description |
|---|---|
| Boolean Supported by the .NET Compact Framework. | A simple type representing Boolean values of true or false. |
| Byte Supported by the .NET Compact Framework. | An integral type representing unsigned 8-bit integers with values between 0 and 255. |
| Char Supported by the .NET Compact Framework. | An integral type representing unsigned 16-bit integers with values between 0 and 65535. The set of possible values for the Char type corresponds to the Unicode character set. |
| DateTime Supported by the .NET Compact Framework. | A type representing a date and time value. |
| DBNull Supported by the .NET Compact Framework. | A database null (column) value. |
| Decimal Supported by the .NET Compact Framework. | A simple type representing values ranging from 1.0 x 10-28 to approximately 7.9 x 10 28 with 28-29 significant digits. |
| Double Supported by the .NET Compact Framework. | A floating point type representing values ranging from approximately 5.0 x 10-324 to 1.7 x 10 308 with a precision of 15-16 digits. |
| Empty Supported by the .NET Compact Framework. | A null reference. |
| Int16 Supported by the .NET Compact Framework. | An integral type representing signed 16-bit integers with values between -32768 and 32767. |
| Int32 Supported by the .NET Compact Framework. | An integral type representing signed 32-bit integers with values between -2147483648 and 2147483647. |
| Int64 Supported by the .NET Compact Framework. | An integral type representing signed 64-bit integers with values between -9223372036854775808 and 9223372036854775807. |
| Object Supported by the .NET Compact Framework. | A general type representing any reference or value type not explicitly represented by another TypeCode. |
| SByte Supported by the .NET Compact Framework. | An integral type representing signed 8-bit integers with values between -128 and 127. |
| Single Supported by the .NET Compact Framework. | A floating point type representing values ranging from approximately 1.5 x 10-45 to 3.4 x 10 38 with a precision of 7 digits. |
| String Supported by the .NET Compact Framework. | A sealed class type representing Unicode character strings. |
| UInt16 Supported by the .NET Compact Framework. | An integral type representing unsigned 16-bit integers with values between 0 and 65535. |
| UInt32 Supported by the .NET Compact Framework. | An integral type representing unsigned 32-bit integers with values between 0 and 4294967295. |
| UInt64 Supported by the .NET Compact Framework. | An integral type representing unsigned 64-bit integers with values between 0 and 18446744073709551615. |
Example
The following code example demonstrates how the TypeCode enumeration can be used. In a decision block inside the WriteObjectInfo method, the TypeCode of an Object parameter is examined, and an appropriate message is written to the Console.
Requirements
Namespace: System
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework
Assembly: Mscorlib (in Mscorlib.dll)