OdbcType OdbcType OdbcType OdbcType Enum

定义

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

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

字段

BigInt BigInt BigInt BigInt 1

精度为 19(有符号)或 20(无符号)且小数位数为 0 的精确数值(有符号:-2[63] <= n <= 2[63] - 1,无符号:0 <= n <= 2[64] - 1)(SQL_BIGINT)。Exact numeric value with precision 19 (if signed) or 20 (if unsigned) and scale 0 (signed: -2[63] <= n <= 2[63] - 1, unsigned:0 <= n <= 2[64] - 1) (SQL_BIGINT). 它映射到 Int64This maps to Int64.

Binary Binary Binary Binary 2

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

Bit Bit Bit Bit 3

只有一位的二进制数据 (SQL_BIT)。Single bit binary data (SQL_BIT). 它映射到 BooleanThis maps to Boolean.

Char Char Char Char 4

固定长度字符串 (SQL_CHAR)。A fixed-length character string (SQL_CHAR). 它映射到 StringThis maps to String.

Date Date Date Date 23

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

DateTime DateTime DateTime DateTime 5

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

Decimal Decimal Decimal Decimal 6

精度至少为 p 且小数位数为 s 的有符号精确数值,其中 1 <= p <= 15 且 s <= p。Signed, exact, numeric value with a precision of at least p and scale s, where 1 <= p <= 15 and s <= p. 最大精度因驱动程序而定 (SQL_DECIMAL)。The maximum precision is driver-specific (SQL_DECIMAL). 它映射到 DecimalThis maps to Decimal.

Double Double Double Double 8

有符号的近似数值,其二进制精度为 53 (零或绝对值为 10[-308] 到 10[308]) (SQL_DOUBLE)。Signed, approximate, numeric value with a binary precision 53 (zero or absolute value 10[-308] to 10[308]) (SQL_DOUBLE). 它映射到 DoubleThis maps to Double.

Image Image Image Image 9

变长二进制数据。Variable length binary data. 最大长度因数据源而定 (SQL_LONGVARBINARY)。Maximum length is data source-dependent (SQL_LONGVARBINARY). 它映射到 Array 类型的 ByteThis maps to an Array of type Byte.

Int Int Int Int 10

精度为 10 且小数位数为 0 的精确数值(有符号:-2[31] <= n <= 2[31] - 1,无符号:0 <= n <= 2[32] - 1)(SQL_INTEGER)。Exact numeric value with precision 10 and scale 0 (signed: -2[31] <= n <= 2[31] - 1, unsigned:0 <= n <= 2[32] - 1) (SQL_INTEGER). 它映射到 Int32This maps to Int32.

NChar NChar NChar NChar 11

固定长度的 Unicode 字符串 (SQL_WCHAR)。Unicode character string of fixed string length (SQL_WCHAR). 它映射到 StringThis maps to String.

NText NText NText NText 12

Unicode 变长字符数据。Unicode variable-length character data. 最大长度因数据源而定。Maximum length is data source-dependent. (SQL_WLONGVARCHAR)。(SQL_WLONGVARCHAR). 它映射到 StringThis maps to String.

Numeric Numeric Numeric Numeric 7

精度为 p 且小数位数为 s 的有符号的精确数值,其中 1 <= p <= 15 且 s <= p (SQL_NUMERIC)。Signed, exact, numeric value with a precision p and scale s, where 1 <= p <= 15, and s <= p (SQL_NUMERIC). 它映射到 DecimalThis maps to Decimal.

NVarChar NVarChar NVarChar NVarChar 13

Unicode 字符的变长流 (SQL_WVARCHAR)。A variable-length stream of Unicode characters (SQL_WVARCHAR). 它映射到 StringThis maps to String.

Real Real Real Real 14

有符号的近似数值,其二进制精度为 24 (零或绝对值为 10[-38] 到 10[38])。(SQL_REAL)。Signed, approximate, numeric value with a binary precision 24 (zero or absolute value 10[-38] to 10[38]).(SQL_REAL). 它映射到 SingleThis maps to Single.

SmallDateTime SmallDateTime SmallDateTime SmallDateTime 16

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

SmallInt SmallInt SmallInt SmallInt 17

精度为 5 且小数位数为 0 的精确数值(有符号:-32,768 <= n <= 32,767,无符号:0 <= n <= 65,535) (SQL_SMALLINT)。Exact numeric value with precision 5 and scale 0 (signed: -32,768 <= n <= 32,767, unsigned: 0 <= n <= 65,535) (SQL_SMALLINT). 它映射到 Int16This maps to Int16.

Text Text Text Text 18

变长字符数据。Variable length character data. 最大长度因数据源而定 (SQL_LONGVARCHAR)。Maximum length is data source-dependent (SQL_LONGVARCHAR). 它映射到 StringThis maps to String.

Time Time Time Time 24

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

Timestamp Timestamp Timestamp Timestamp 19

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

TinyInt TinyInt TinyInt TinyInt 20

精度为 3 且小数位数为 0 的精确数值(有符号:-128 <= n <= 127,无符号:0 <= n <= 255)(SQL_TINYINT)。Exact numeric value with precision 3 and scale 0 (signed: -128 <= n <= 127, unsigned:0 <= n <= 255)(SQL_TINYINT). 它映射到 ByteThis maps to Byte.

UniqueIdentifier UniqueIdentifier UniqueIdentifier UniqueIdentifier 15

固定长度的 GUID (SQL_GUID)。A fixed-length GUID (SQL_GUID). 它映射到 GuidThis maps to Guid.

VarBinary VarBinary VarBinary VarBinary 21

变长二进制。Variable length binary. 由用户设置该最大值 (SQL_VARBINARY)。The maximum is set by the user (SQL_VARBINARY). 它映射到 Array 类型的 ByteThis maps to an Array of type Byte.

VarChar VarChar VarChar VarChar 22

变长流字符串 (SQL_CHAR)。A variable-length stream character string (SQL_CHAR). 它映射到 StringThis maps to String.

注解

下表显示了数据类型OdbcType 、ODBC 数据类型 (显示在括号中) 和 .NET Framework 类型之间的映射。The following table shows mappings between OdbcType data types, ODBC data types (shown in parentheses), and .NET Framework types.

适用于