OleDbType 枚举

定义

指定字段的数据类型、属性,以便在 OleDbParameter 中使用。Specifies the data type of a field, a property, for use in an OleDbParameter.

public enum class OleDbType
public enum OleDbType
type OleDbType = 
Public Enum OleDbType
继承
OleDbType

字段

BigInt 20

64 位带符号的整数 (DBTYPE_I8)。A 64-bit signed integer (DBTYPE_I8). 它映射到 Int64This maps to Int64.

Binary 128

二进制数据流 (DBTYPE_BYTES)。A stream of binary data (DBTYPE_BYTES). 它映射到 Array 类型的 ByteThis maps to an Array of type Byte.

Boolean 11

布尔值 (DBTYPE_BOOL)。A Boolean value (DBTYPE_BOOL). 它映射到 BooleanThis maps to Boolean.

BSTR 8

以 null 终止的 Unicode 字符串 (DBTYPE_BSTR)。A null-terminated character string of Unicode characters (DBTYPE_BSTR). 它映射到 StringThis maps to String.

Char 129

字符串 (DBTYPE_STR)。A character string (DBTYPE_STR). 它映射到 StringThis maps to String.

Currency 6

一个货币值,范围在 -2 63(或 -922,337,203,685,477.5808)到 2 63 -1(或 +922,337,203,685,477.5807)之间,精度为千分之十个货币单位 (DBTYPE_CY)。A 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). 它映射到 DecimalThis maps to Decimal.

Date 7

日期数据,存储为双精度型 (DBTYPE_DATE)。Date data, stored as a double (DBTYPE_DATE). 整数部分是自 1899 年 12 月 30 日以来的天数,而小数部分是不足一天的部分。The whole portion is the number of days since December 30, 1899, and the fractional portion is a fraction of a day. 它映射到 DateTimeThis maps to DateTime.

DBDate 133

格式为 yyyymmdd 的日期数据 (DBTYPE_DBDATE)。Date data in the format yyyymmdd (DBTYPE_DBDATE). 它映射到 DateTimeThis maps to DateTime.

DBTime 134

格式为 hhmmss 的时间数据 (DBTYPE_DBTIME)。Time data in the format hhmmss (DBTYPE_DBTIME). 它映射到 TimeSpanThis maps to TimeSpan.

DBTimeStamp 135

格式为 yyyymmddhhmmss 的日期和时间数据 (DBTYPE_DBTIMESTAMP)。Data and time data in the format yyyymmddhhmmss (DBTYPE_DBTIMESTAMP). 它映射到 DateTimeThis maps to DateTime.

Decimal 14

定点精度和小数位数数值,范围在 -10 38 -1 和 10 38 -1 之间 (DBTYPE_DECIMAL)。A fixed precision and scale numeric value between -10 38 -1 and 10 38 -1 (DBTYPE_DECIMAL). 它映射到 DecimalThis maps to Decimal.

Double 5

浮点数字,范围在 -1.79E +308 到 1.79E +308 之间 (DBTYPE_R8)。A floating-point number within the range of -1.79E +308 through 1.79E +308 (DBTYPE_R8). 它映射到 DoubleThis maps to Double.

Empty 0

无任何值 (DBTYPE_EMPTY)。No value (DBTYPE_EMPTY).

Error 10

32 位错误代码 (DBTYPE_ERROR)。A 32-bit error code (DBTYPE_ERROR). 它映射到 ExceptionThis maps to Exception.

Filetime 64

64 位无符号整数,表示自 1601 年 1 月 1 日以来 100 个纳秒间隔的数字 (DBTYPE_FILETIME)。A 64-bit unsigned integer representing the number of 100-nanosecond intervals since January 1, 1601 (DBTYPE_FILETIME). 它映射到 DateTimeThis maps to DateTime.

Guid 72

全局唯一标识符(或 GUID) (DBTYPE_GUID)。A globally unique identifier (or GUID) (DBTYPE_GUID). 它映射到 GuidThis maps to Guid.

IDispatch 9

指向 IDispatch 接口的指针 (DBTYPE_IDISPATCH)。A pointer to an IDispatch interface (DBTYPE_IDISPATCH). 它映射到 ObjectThis maps to Object.

ADO.NET 当前不支持此数据类型。This data type is not currently supported by ADO.NET. 使用它可能会导致不可预测的结果。Its usage may cause unpredictable results.

Integer 3

32 位带符号的整数 (DBTYPE_I4)。A 32-bit signed integer (DBTYPE_I4). 它映射到 Int32This maps to Int32.

IUnknown 13

指向 IUnknown 接口的指针 (DBTYPE_UNKNOWN)。A pointer to an IUnknown interface (DBTYPE_UNKNOWN). 它映射到 ObjectThis maps to Object.
ADO.NET 当前不支持此数据类型。This data type is not currently supported by ADO.NET. 使用它可能会导致不可预测的结果。Its usage may cause unpredictable results.

LongVarBinary 205

长的二进制值(只限 OleDbParameter)。A long binary value (OleDbParameter only). 它映射到 Array 类型的 ByteThis maps to an Array of type Byte.

LongVarChar 201

长的字符串值(只限 OleDbParameter)。A long string value (OleDbParameter only). 它映射到 StringThis maps to String.

LongVarWChar 203

长的以 null 终止的 Unicode 字符串值(只限 OleDbParameter)。A long null-terminated Unicode string value (OleDbParameter only). 它映射到 StringThis maps to String.

Numeric 131

具有定点精度和小数位数的精确数值 (DBTYPE_NUMERIC)。An exact numeric value with a fixed precision and scale (DBTYPE_NUMERIC). 它映射到 DecimalThis maps to Decimal.

PropVariant 138

自动化 PROPVARIANT (DBTYPE_PROP_VARIANT)。An automation PROPVARIANT (DBTYPE_PROP_VARIANT). 它映射到 ObjectThis maps to Object.

Single 4

浮点数字,范围在 -3.40E +38 到 3.40E +38 之间 (DBTYPE_R4)。A floating-point number within the range of -3.40E +38 through 3.40E +38 (DBTYPE_R4). 它映射到 SingleThis maps to Single.

SmallInt 2

16 位带符号的整数 (DBTYPE_I2)。A 16-bit signed integer (DBTYPE_I2). 它映射到 Int16This maps to Int16.

TinyInt 16

8 位带符号的整数 (DBTYPE_I1)。A 8-bit signed integer (DBTYPE_I1). 它映射到 SByteThis maps to SByte.

UnsignedBigInt 21

64 位无符号整数 (DBTYPE_UI8)。A 64-bit unsigned integer (DBTYPE_UI8). 它映射到 UInt64This maps to UInt64.

UnsignedInt 19

32 位无符号整数 (DBTYPE_UI4)。A 32-bit unsigned integer (DBTYPE_UI4). 它映射到 UInt32This maps to UInt32.

UnsignedSmallInt 18

16 位无符号整数 (DBTYPE_UI2)。A 16-bit unsigned integer (DBTYPE_UI2). 它映射到 UInt16This maps to UInt16.

UnsignedTinyInt 17

8 位无符号整数 (DBTYPE_UI1)。A 8-bit unsigned integer (DBTYPE_UI1). 它映射到 ByteThis maps to Byte.

VarBinary 204

二进制数据的变长流(只限 OleDbParameter)。A variable-length stream of binary data (OleDbParameter only). 它映射到 Array 类型的 ByteThis maps to an Array of type Byte.

VarChar 200

非 Unicode 字符的变长流(只限 OleDbParameter)。A variable-length stream of non-Unicode characters (OleDbParameter only). 它映射到 StringThis maps to String.

Variant 12

可包含数字、字符串、二进制或日期数据以及特殊值 Empty 和 Null 的特殊数据类型 (DBTYPE_VARIANT)。A 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. 它映射到 ObjectThis maps to Object.

VarNumeric 139

变长数值(只限 OleDbParameter)。A variable-length numeric value (OleDbParameter only). 它映射到 DecimalThis maps to Decimal.

VarWChar 202

长可变、以 null 终止的 Unicode 字符流(只限 OleDbParameter)。A variable-length, null-terminated stream of Unicode characters (OleDbParameter only). 它映射到 StringThis maps to String.

WChar 130

以 null 终止的 Unicode 字符流 (DBTYPE_WSTR)。A null-terminated stream of Unicode characters (DBTYPE_WSTR). 它映射到 StringThis maps to String.

注解

上表显示数据类型之间OleDbType的映射、OLE DB 数据类型 (显示在括号中) 和 .NET Framework 类型。The preceding table shows mappings between OleDbType data types, OLE DB data types (shown in parentheses), and the .NET Framework types. 在参数化查询System.Char[]中, OleDbType数据类型接受。 Parameter.ValueThe OleDbType data types accept System.Char[] as Parameter.Value in parameterized queries.

适用于