Mapping dei tipi di dati OLE DB (ADO.NET)
Nella tabella seguente sono illustrati i tipi .NET Framework dedotti per i tipi di dati dal provider di dati .NET Framework per ADO e OLE DB (System.Data.OleDb). Sono elencati inoltre i metodi delle funzioni di accesso tipizzate per OleDbDataReader.
Tipo ADO |
Tipo OLE DB |
Tipo .NET Framework |
Funzione di accesso tipizzata .NET Framework |
---|---|---|---|
adBigInt |
DBTYPE_I8 |
Int64 |
GetInt64() |
adBinary |
DBTYPE_BYTES |
Byte[] |
GetBytes() |
adBoolean |
DBTYPE_BOOL |
Boolean |
GetBoolean() |
adBSTR |
DBTYPE_BSTR |
String |
GetString() |
adChapter |
DBTYPE_HCHAPTER |
Supportato mediante DataReader. Vedere Recupero di dati mediante un DataReader (ADO.NET). |
GetValue() |
adChar |
DBTYPE_STR |
String |
GetString() |
adCurrency |
DBTYPE_CY |
Decimal |
GetDecimal() |
adDate |
DBTYPE_DATE |
DateTime |
GetDateTime() |
adDBDate |
DBTYPE_DBDATE |
DateTime |
GetDateTime() |
adDBTime |
DBTYPE_DBTIME |
DateTime |
GetDateTime() |
adDBTimeStamp |
DBTYPE_DBTIMESTAMP |
DateTime |
GetDateTime() |
adDecimal |
DBTYPE_DECIMAL |
Decimal |
GetDecimal() |
adDouble |
DBTYPE_R8 |
Double |
GetDouble() |
adError |
DBTYPE_ERROR |
ExternalException |
GetValue() |
adFileTime |
DBTYPE_FILETIME |
DateTime |
GetDateTime() |
adGUID |
DBTYPE_GUID |
Guid |
GetGuid() |
adIDispatch |
DBTYPE_IDISPATCH * |
Object |
GetValue() |
adInteger |
DBTYPE_I4 |
Int32 |
GetInt32() |
adIUnknown |
DBTYPE_IUNKNOWN * |
Object |
GetValue() |
adNumeric |
DBTYPE_NUMERIC |
Decimal |
GetDecimal() |
adPropVariant |
DBTYPE_PROPVARIANT |
Object |
GetValue() |
adSingle |
DBTYPE_R4 |
Single |
GetFloat() |
adSmallInt |
DBTYPE_I2 |
Int16 |
GetInt16() |
adTinyInt |
DBTYPE_I1 |
Byte |
GetByte() |
adUnsignedBigInt |
DBTYPE_UI8 |
UInt64 |
GetValue() |
adUnsignedInt |
DBTYPE_UI4 |
UInt32 |
GetValue() |
adUnsignedSmallInt |
DBTYPE_UI2 |
UInt16 |
GetValue() |
adUnsignedTinyInt |
DBTYPE_UI1 |
Byte |
GetByte() |
adVariant |
DBTYPE_VARIANT |
Object |
GetValue() |
adWChar |
DBTYPE_WSTR |
String |
GetString() |
adUserDefined |
DBTYPE_UDT |
Non supportato |
|
adVarNumeric |
DBTYPE_VARNUMERIC |
Non supportato |
|
* Per i tipi OLE DB DBTYPE_IUNKNOWN e DBTYPE_IDISPATCH, il riferimento all'oggetto è una rappresentazione con marshalling del puntatore.