Export (0) Print
Expand All

OleDbType Enumeration

Specifies the data type of a field, a property, for use in an OleDbParameter.

Namespace:  System.Data.OleDb
Assembly:  System.Data (in System.Data.dll)

public enum OleDbType

Member nameDescription
BigIntA 64-bit signed integer (DBTYPE_I8). This maps to Int64.
BinaryA stream of binary data (DBTYPE_BYTES). This maps to an Array of type Byte.
BooleanA Boolean value (DBTYPE_BOOL). This maps to Boolean.
BSTRA null-terminated character string of Unicode characters (DBTYPE_BSTR). This maps to String.
CharA character string (DBTYPE_STR). This maps to String.
CurrencyA currency value ranging from -2 63 (or -922,337,203,685,477.5808) to 2 63 -1 (or +922,337,203,685,477.5807) with an accuracy to a ten-thousandth of a currency unit (DBTYPE_CY). This maps to Decimal.
DateDate data, stored as a double (DBTYPE_DATE). The whole portion is the number of days since December 30, 1899, and the fractional portion is a fraction of a day. This maps to DateTime.
DBDateDate data in the format yyyymmdd (DBTYPE_DBDATE). This maps to DateTime.
DBTimeTime data in the format hhmmss (DBTYPE_DBTIME). This maps to TimeSpan.
DBTimeStampData and time data in the format yyyymmddhhmmss (DBTYPE_DBTIMESTAMP). This maps to DateTime.
DecimalA fixed precision and scale numeric value between -10 38 -1 and 10 38 -1 (DBTYPE_DECIMAL). This maps to Decimal.
DoubleA floating-point number within the range of -1.79E +308 through 1.79E +308 (DBTYPE_R8). This maps to Double.
EmptyNo value (DBTYPE_EMPTY).
ErrorA 32-bit error code (DBTYPE_ERROR). This maps to Exception.
FiletimeA 64-bit unsigned integer representing the number of 100-nanosecond intervals since January 1, 1601 (DBTYPE_FILETIME). This maps to DateTime.
GuidA globally unique identifier (or GUID) (DBTYPE_GUID). This maps to Guid.
IDispatchA pointer to an IDispatch interface (DBTYPE_IDISPATCH). This maps to Object.

This data type is not currently supported by ADO.NET. Usage may cause unpredictable results.

IntegerA 32-bit signed integer (DBTYPE_I4). This maps to Int32.
IUnknownA pointer to an IUnknown interface (DBTYPE_UNKNOWN). This maps to Object.

This data type is not currently supported by ADO.NET. Usage may cause unpredictable results.

LongVarBinaryA long binary value (OleDbParameter only). This maps to an Array of type Byte.
LongVarCharA long string value (OleDbParameter only). This maps to String.
LongVarWCharA long null-terminated Unicode string value (OleDbParameter only). This maps to String.
NumericAn exact numeric value with a fixed precision and scale (DBTYPE_NUMERIC). This maps to Decimal.
PropVariantAn automation PROPVARIANT (DBTYPE_PROP_VARIANT). This maps to Object.
SingleA floating-point number within the range of -3.40E +38 through 3.40E +38 (DBTYPE_R4). This maps to Single.
SmallIntA 16-bit signed integer (DBTYPE_I2). This maps to Int16.
TinyIntA 8-bit signed integer (DBTYPE_I1). This maps to SByte.
UnsignedBigIntA 64-bit unsigned integer (DBTYPE_UI8). This maps to UInt64.
UnsignedIntA 32-bit unsigned integer (DBTYPE_UI4). This maps to UInt32.
UnsignedSmallIntA 16-bit unsigned integer (DBTYPE_UI2). This maps to UInt16.
UnsignedTinyIntA 8-bit unsigned integer (DBTYPE_UI1). This maps to Byte.
VarBinaryA variable-length stream of binary data (OleDbParameter only). This maps to an Array of type Byte.
VarCharA variable-length stream of non-Unicode characters (OleDbParameter only). This maps to String.
VariantA special data type that can contain numeric, string, binary, or date data, and also the special values Empty and Null (DBTYPE_VARIANT). This type is assumed if no other is specified. This maps to Object.
VarNumericA variable-length numeric value (OleDbParameter only). This maps to Decimal.
VarWCharA variable-length, null-terminated stream of Unicode characters (OleDbParameter only). This maps to String.
WCharA null-terminated stream of Unicode characters (DBTYPE_WSTR). This maps to String.

The preceding table shows mappings between OleDbType data types, OLE DB data types (shown in parentheses), and the .NET Framework types. The OleDbType data types accept System.Char[]as Parameter.Value in parameterized queries.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft