> # Data Types

> The data types and isolation levels supported by the .NET data provider depend on the data store to which you are connecting.

> Table 10-1 lists the data types supported by the .NET data provider and how they are mapped to the .NET Framework types. You can use the table to infer the data types that will be used when a DataSet is filled using a DataAdapter. This table also identifies the proper accessors for accessing the data when a DataReader object is used directly.

> - The SequeLink data type column refers to the native type name.
> - The SequeLinkDbType column refers to the SequeLink data provider's type enumeration. Generally, there is a one to one mapping between the native type and the SequeLinkDbType.
> - The .NET Framework Type column refers to the base data types available in the framework.
> - The .NET Framework Typed Accessor column refers to the method that must be used to access a column of this type when using a DataReader.

> Table 10-1. Mapping of SequeLink Data Types
> SequeLink Service Data Type | SequeLinkDbType | .NET Framework Type | .NET Framework Typed Accessor
> --- | --- | --- | ---
> BIGINT | Bigint | Int64 | GetInt64( )
> BINARY | Binary | Byte[] | GetBytes( )
> BIT | Bit | Boolean | GetBoolean( )
> BLOB | Blob | Byte[] | GetBytes( )
> CHAR | Char | String | GetString( ) GetChars( )
> CLOB | Clob | String | GetString( ) GetChars( )
> DATE | Date | DateTime | GetDateTime( )
> DECIMAL | Decimal | Decimal | GetDecimal( )
> DOUBLE | Double | Double | GetDouble( )
> FLOAT | Double | Double | GetDouble( )
> GRAPHIC | Char | String | GetString( ) GetChars( )
> INTEGER | Int | Int32 | GetInt32( )
> LONGVARBINARY | LongVarBinary | Byte[] | GetBytes( )
> LONGVARCHAR | LongVarChar | String | GetString( ) GetChars( )
> NUMBER | Decimal | Decimal | GetDecimal( )
> REAL | Single | Single | GetFloat( )
> SMALLINT | SmallInt | Int16 | GetInt16( )
> TIME | Time | TimeSpan | GetValue( )
> TIMESTAMP | TimeStamp | DateTime | GetDateTime( )
> TINYINT | Byte | Byte[] | GetByte( )
> VARBINARY | VarBinary | Byte[] | GetBytes( )
> VARCHAR | VarChar | String | GetString( ) GetChars( )
> VARGRAPHIC | VarChar | String | GetString( ) GetChars( )

> ### Mapping Parameter Data Types

> The type of the parameter is specific to each data provider. The .NET data provider must convert the parameter value to a native format before sending it to the server. The best way for an application to describe a parameter is to use the data provider-specific type enumeration.

> In generic programming circumstances, the data provider-specific type may not be available. When no provider-specific DB type has been specified, the data type will be inferred from either the System.Data.DbType or from the .NET framework type of the parameter's value.

> The .NET data provider uses the following order when inferring the data type of a parameter:

> - The data provider uses the provider-specific data type if it has been specified.
> - The data provider infers the data type from the System.Data.DbType if it has been specified, but the provider-specific data type has not been specified.
> - The data provider infers the data type from the .NET Framework type if neither the provider-specific data type nor the System.Data.DbType have been specified.

> Table 10-2 shows how SequeLink infers its types if only the System.Data.DbType is specified.

> Table 10-2. Mapping of the System.Data.DbTypes to SequeLinkDbTypes
> System.Data.DbType | SequeLinkDbType
> --- | ---
> AnsiString | VarChar
> AnsiStringFixedLength | Char
> Binary | VarBinary
> Boolean | Bit
> Byte | Byte
> Currency | Decimal
> Date | Date
> DateTime | TimeStamp
> Decimal | Decimal
> Double | Double
> Guid | Not supported
> Int16 | SmallInt
> Int32 | Int
> Int64 | BigInt
> Object | Not supported
> Sbyte | Byte
> Single | Single
> String | VarChar
> StringFixedLength | Char
> Time | Time
> Uint16 | Int
> Uint32 | Decimal
> Uint64 | Decimal
> VarNumeric | Not supported

> Table 10-3 shows the mapping that the data provider uses to infer a data type if neither the provider-specific data type or the System.Data.DbType are provided.

> Table 10-3. Mapping .NET Framework Data Types to SequeLinkDbTypes
> .NET Framework Type | SequeLinkDbType
> --- | ---
> Boolean | Bit
> Byte | Byte
> Byte[] | Varbinary
> Char, Char[] | Not supported
> DateTime | TimeStamp
> Decimal | Decimal
> Double | Double
> Guid | Not supported
> Int16 | SmallInt
> Int32 | Int
> Int64 | BigInt
> Object | Not supported
> Single | Single
> String | VarChar
> Timespan | Time
> Uint16 | Int
> Uint32 | Decimal
> Uint64 | Decimal