12. Understanding .NET Data Provider Connectivity : Data Types Mapping
 
Share this page                  
Data Types Mapping
The .NET Data Provider defines its own enumeration of supported data types in addition to the standard System.Data.DbType enumeration.
The following table shows the mapping of the .NET Data Provider's data types to its .NET data type counterparts. For information on the typed accessors that a .NET application uses for an Ingres native database type to be obtained as a .NET type, see IngresDataReader Class (see page IngresDataReader Class).
IngresType
Ingres
Data Type
Description
.NET Data Type
Binary
byte
Fixed length stream of binary data
Byte[ ]
Boolean
boolean
Boolean values of true and false
Boolean
Char
char
Fixed length stream of character data
String
Date
ansidate
Date data
DateTime
Time
time
Time data
DateTime
DateTime
timestamp
Date and time data
DateTime
IngresDate
ingresdate
Ingres format date
DateTime
IntervalYearToMonth
interval year to month
Interval year to month
String
IntervalDayToSecond
interval day to second
Interval day to second
TimeSpan
Decimal
decimal
Exact numeric data
Decimal
Double
double precision (float8)
Approximate numeric data
Double
SmallInt
smallint
Signed 16-bit integer data
Int16
TinyInt
integer1
Signed 8-bit integer data
SByte
Int
integer
Signed 32-bit integer data
Int32
BigInt
bigint
Signed 64-bit integer data
Int64
LongVarBinary
long byte
Binary large object
Byte[ ]
LongVarChar
long varchar
Character large object
String
LongNVarChar
long nvarchar
Unicode large object
String
NChar
nchar
Fixed length stream of Unicode data
String
NVarChar
nvarchar
Variable length stream of Unicode data
String
Real
real (float4)
Approximate numeric data
Single
VarBinary
byte varying
Variable length stream of binary data
Byte[ ]
VarChar
varchar
Variable length stream of character data
String
Note:   
DateTime literals within SQL CommandText must be specified in the form of {d 'yyyy-mm-dd'} for dates and {ts 'yyyy-mm-dd hh-mm-ss'} for timestamps. However, it is preferable to pass .NET DateTime parameters rather than literals for these values.
For Ingres servers, DateTime parameters are converted to UTC values before being sent to the Ingres servers. DateTime values retrieved from Ingres servers are converted from UTC values to Local values. For non-Ingres servers, DateTime values are passed between the data provider and servers unchanged.
IngresType.DateTime parameter data is sent by the data provider depending on the level of support of the ANSI Date/Time data types. You can override the default behavior by specifying the IngresType.IngresDate data type for the parameter data rather than IngresType.DateTime. IngresType.IngresDate parameter data type forces the data provider to send the date/time parameter data as INGRESDATE type and value. For more information, see SendIngresDate Connection Keyword (see page SendIngresDates Connection Keyword).