下表显示推断的 .NET Framework 类型、DbType 和 SqlDbType 枚举以及 SqlDataReader 的访问器方法。
BigInt | GetSqlInt64 | Int64 | GetInt64 | ||
VarBinary | GetSqlBinary | Binary | GetBytes | ||
Bit | GetSqlBoolean | Boolean | GetBoolean | ||
Char | GetSqlString | String | GetString GetChars | ||
Date | GetSqlDateTime | Date | GetDateTime | ||
DateTime | GetSqlDateTime | DateTime | GetDateTime | ||
DateTime2 | DateTime2 | GetDateTime | |||
DateTimeOffset | DateTimeOffset | GetDateTimeOffset | |||
Decimal | GetSqlDecimal | Decimal | GetDecimal | ||
VarBinary | GetSqlBytes | Binary | GetBytes | ||
Float | GetSqlDouble | Double | GetDouble | ||
Binary | GetSqlBinary | Binary | GetBytes | ||
Int | GetSqlInt32 | Int32 | GetInt32 | ||
Money | GetSqlMoney | Decimal | GetDecimal | ||
NChar | GetSqlString | StringFixedLength | GetString GetChars | ||
NText | GetSqlString | String | GetString GetChars | ||
Decimal | GetSqlDecimal | Decimal | GetDecimal | ||
NVarChar | GetSqlString | String | GetString GetChars | ||
Real | GetSqlSingle | Single | GetFloat | ||
Timestamp | GetSqlBinary | Binary | GetBytes | ||
DateTime | GetSqlDateTime | DateTime | GetDateTime | ||
SmallInt | GetSqlInt16 | Int16 | GetInt16 | ||
SmallMoney | GetSqlDecimal | Decimal | GetDecimal | ||
Variant | Object | ||||
Text | GetSqlString | String | GetString GetChars | ||
Time | Time | GetDateTime | |||
Timestamp | GetSqlBinary | Binary | GetBytes | ||
TinyInt | GetSqlByte | Byte | GetByte | ||
UniqueIdentifier | GetSqlGuid | Guid | GetGuid | ||
VarBinary | GetSqlBinary | Binary | GetBytes | ||
VarChar | GetSqlString | GetString GetChars | |||
Xml | GetSqlXml | Xml |