OdbcType OdbcType OdbcType OdbcType Enum

Definition

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
Inheritance

Fields

BigInt BigInt BigInt BigInt 1

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). This maps to Int64.

Binary Binary Binary Binary 2

A stream of binary data (SQL_BINARY). This maps to an Array of type Byte.

Bit Bit Bit Bit 3

Single bit binary data (SQL_BIT). This maps to Boolean.

Char Char Char Char 4

A fixed-length character string (SQL_CHAR). This maps to String.

Date Date Date Date 23

Date data in the format yyyymmdd (SQL_TYPE_DATE). This maps to DateTime.

DateTime DateTime DateTime DateTime 5

Date data in the format yyyymmddhhmmss (SQL_TYPE_TIMESTAMP). This maps to DateTime.

Decimal Decimal Decimal Decimal 6

Signed, exact, numeric value with a precision of at least p and scale s, where 1 <= p <= 15 and s <= p. The maximum precision is driver-specific (SQL_DECIMAL). This maps to Decimal.

Double Double Double Double 8

Signed, approximate, numeric value with a binary precision 53 (zero or absolute value 10[-308] to 10[308]) (SQL_DOUBLE). This maps to Double.

Image Image Image Image 9

Variable length binary data. Maximum length is data source-dependent (SQL_LONGVARBINARY). This maps to an Array of type Byte.

Int Int Int Int 10

Exact numeric value with precision 10 and scale 0 (signed: -2[31] <= n <= 2[31] - 1, unsigned:0 <= n <= 2[32] - 1) (SQL_INTEGER). This maps to Int32.

NChar NChar NChar NChar 11

Unicode character string of fixed string length (SQL_WCHAR). This maps to String.

NText NText NText NText 12

Unicode variable-length character data. Maximum length is data source-dependent. (SQL_WLONGVARCHAR). This maps to String.

Numeric Numeric Numeric Numeric 7

Signed, exact, numeric value with a precision p and scale s, where 1 <= p <= 15, and s <= p (SQL_NUMERIC). This maps to Decimal.

NVarChar NVarChar NVarChar NVarChar 13

A variable-length stream of Unicode characters (SQL_WVARCHAR). This maps to String.

Real Real Real Real 14

Signed, approximate, numeric value with a binary precision 24 (zero or absolute value 10[-38] to 10[38]).(SQL_REAL). This maps to Single.

SmallDateTime SmallDateTime SmallDateTime SmallDateTime 16

Data and time data in the format yyyymmddhhmmss (SQL_TYPE_TIMESTAMP). This maps to DateTime.

SmallInt SmallInt SmallInt SmallInt 17

Exact numeric value with precision 5 and scale 0 (signed: -32,768 <= n <= 32,767, unsigned: 0 <= n <= 65,535) (SQL_SMALLINT). This maps to Int16.

Text Text Text Text 18

Variable length character data. Maximum length is data source-dependent (SQL_LONGVARCHAR). This maps to String.

Time Time Time Time 24

Date data in the format hhmmss (SQL_TYPE_TIMES). This maps to DateTime.

Timestamp Timestamp Timestamp Timestamp 19

A stream of binary data (SQL_BINARY). This maps to an Array of type Byte.

TinyInt TinyInt TinyInt TinyInt 20

Exact numeric value with precision 3 and scale 0 (signed: -128 <= n <= 127, unsigned:0 <= n <= 255)(SQL_TINYINT). This maps to Byte.

UniqueIdentifier UniqueIdentifier UniqueIdentifier UniqueIdentifier 15

A fixed-length GUID (SQL_GUID). This maps to Guid.

VarBinary VarBinary VarBinary VarBinary 21

Variable length binary. The maximum is set by the user (SQL_VARBINARY). This maps to an Array of type Byte.

VarChar VarChar VarChar VarChar 22

A variable-length stream character string (SQL_CHAR). This maps to String.

Remarks

The following table shows mappings between OdbcType data types, ODBC data types (shown in parentheses), and .NET Framework types.

Applies to