PreviousData Provider for .NET Guide (9.1 revision 1) Next

Data Types

Show this topic in Library frames

Table 2-2 lists the data types supported by the Pervasive.SQL 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.

Mapping Parameter Data Types

The type of the parameter is specific to each data provider. The Pervasive.SQL 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 Pervasive.SQL data provider uses the following order when inferring the data type of a parameter:

Table 2-3 shows how Pervasive.SQL infers its types if only the System.Data.DbType is specified.

Table 2-3 Mapping System.Data.DbTypes to PsqlDbTypes  
System.Data.DbType
PsqlDbType
AnsiString
VarChar
AnsiStringFixedLength
Char
Binary
Binary
Boolean
Integer
Byte
Integer
Currency
Currency
Date
Date
DateTime
Timestamp
Decimal
Decimal
Double
Double
Int16
SmallInt
Int32
Integer
Int64
BigInt
Sbyte
Integer
Single
BFloat4
String
VarChar
StringFixedLength
Char
Time
Time
Uint16
USmallInt
Uint32
UInteger
Uint64
UBigInt
VarNumeric
Decimal

Table 2-4 shows the mapping that the data provider uses to infer a data type if neither the provider-specific data type nor the System.Data.DbType are provided.

Table 2-4 Mapping .NET Framework Types to PsqlDbTypes  
.NET Framework Type
PsqlDbType
Boolean
Integer
Byte
Integer
Byte[]
Binary
DateTime
Timestamp
Decimal
Decimal
Double
Double
Int16
SmallInt
Int32
Integer
Int64
BigInt
Single
BFloat4
String
VarChar
Uint16
USmallInt
Uint32
UInteger
Uint64
UBigInt

Data Types Supported With Stream Objects

The Pervasive.SQL data provider supports the use of streams as inputs to long data parameters with the data types listed in Table 2-5.

Table 2-5 Supported Stream Objects
Provider Data Type
Stream Type Supported
LONGVARBINARY
Stream
LONGVARCHAR
TextReader

See Using Streams as Input to Long Data Parameters for a discussion of using streams.


Chapter contents
Publication contents

Prev topic: Understanding Connection Failover and Client Load Balancing
Next topic: Using Streams as Input to Long Data Parameters