Managed Data Type Mappings (SQL Server Compact)
Microsoft SQL Server Compact 3.5 (SQL Server Compact 3.5) does not fully support all .NET data types; when data is accessed by using ADO.NET, SQL Server Compact 3.5 must translate unsupported types to those that are supported.
Data Type Mappings
The following table shows the data type mappings between SQL Server Compact 3.5 and the .NET data provider.
.NET Data Type | SQL Server Compact 3.5 Data Type |
---|---|
binary |
varbinary |
boolean |
bit |
byte |
tinyint |
byte[] |
varbinary |
datetime |
datetime |
decimal |
numeric |
double |
float |
guid |
uniqueidentifier |
image |
image |
int16 |
smallint |
int32 |
int |
int64 |
bigint |
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 3.5 supports SqlDecimal data type only up to 96 bits. If 96 bits are exceeded, SQL Server Compact 3.5 throws an overflow exception error.
See Also
Other Resources
Building Managed Applications (SQL Server Compact)
Data Types