ODBC Data Type Mappings

 

The following table shows the inferred .NET Framework type for data types from the .NET Framework Data Provider for ODBC (System.Data.Odbc). The typed accessor methods for the OdbcDataReader are also listed.

ODBC type.NET Framework type.NET Framework typed accessor
SQL_BIGINTInt64GetInt64()
SQL_BINARYByte[]GetBytes()
SQL_BITBooleanGetBoolean()
SQL_CHARString

Char[]
GetString()

GetChars()
SQL_DECIMALDecimalGetDecimal()
SQL_DOUBLEDoubleGetDouble()
SQL_GUIDGuidGetGuid()
SQL_INTEGERInt32GetInt32()
SQL_LONG_VARCHARString

Char[]
GetString()

GetChars()
SQL_LONGVARBINARYByte[]GetBytes()
SQL_NUMERICDecimalGetDecimal()
SQL_REALSingleGetFloat()
SQL_SMALLINTInt16GetInt16()
SQL_TINYINTByteGetByte()
SQL_TYPE_TIMESDateTimeGetDateTime()
SQL_TYPE_TIMESTAMPDateTimeGetDateTime()
SQL_VARBINARYByte[]GetBytes()
SQL_WCHARString

Char[]
GetString()

GetChars()
SQL_WLONGVARCHARString

Char[]
GetString()

GetChars()
SQL_WVARCHARString

Char[]
GetString()

GetChars()

Retrieving and Modifying Data in ADO.NET
ADO.NET Managed Providers and DataSet Developer Center

Show: