Jaa


Managed Data Type Mappings (SQL Server Compact Edition)

Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) does not fully support all .NET data types; when data is accessed by using ADO.NET, SQL Server Compact Edition must translate unsupported types to those that are supported.

Data Type Mappings

The following table shows the data type mappings between SQL Server Compact Edition and the .NET data provider.

.NET Data Type SQL Server Compact Edition Data Type

binary

varbinary

boolean

bit

byte

tinyint

byte[]

varbinary

datetime

datetime

decimal

numeric

double

float

guid

uniqueidentifier

image

image

int16

smallint

Uint16

uint16

int32

int

Uint32

uint32

int64

bigint

Uint64

uint64

SqlBinary

varbinary

SqlBoolean

bit

SqlByte

tinyint

SqlDecimal¹

numeric

SqlDateTime

datetime

SqlDouble

float

SqlGuid

uniqueidentifier

SqlInt16

smallint

SqlInt32

int

SqlInt64

bigint

SqlMoney

money

SqlSingle

real

SqlString

nvarchar

single

real

string

nvarchar

¹ SQL Server Compact Edition supports SqlDecimal data type only up to 96 bits. If 96 bits are exceeded, SQL Server Compact Edition throws an overflow exception error.

See Also

Other Resources

Building Managed Applications (SQL Server Compact Edition)
Data Types

Help and Information

Getting SQL Server Compact Edition Assistance