Data Access has been discontinued. Please refer to this page for more information.

Type Mapping

This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.

Telerik Data Access supports flexible mappings from .NET types (e.g., System.String) to database specific SQL types (e.g., VARCHAR2 on Oracle). The default mappings can be customized for a specific datastore. The mapping for specific fields can also be customized. Mappings are resolved by first using any information specified for the field, then looking up a generic type for the type of the field using the .NET Type Mapping, then converting this generic type into actual SQL type information using the Generic Type Mapping. You can have different mapping information for each database supported by Telerik Data Access.

Mapping a Simple (Scalar) Fields

The default mappings from .NET types to backend specific types are shown in tables below.

.NET Type MSSQL Type MySQL Type Oracle Type
System.Boolean TINYINT BIT NUMBER
System.Char CHAR(1) CHAR(1) CHAR(1)
System.SByte SMALLINT TINYINT NUMBER
System.Byte SMALLINT SMALLINT NUMBER
System.Int16 SMALLINT SMALLINT NUMBER
System.UInt16 INT INT NUMBER
System.Int32 INT INT NUMBER
System.UInt32 BIGINT BIGINT NUMBER(19)
System.Int64 BIGINT BIGINT NUMBER(19)
System.UInt64 DECIMAL(20,0) DECIMAL(20,0) NUMBER
System.Single REAL FLOAT FLOAT(63)
System.Double FLOAT DOUBLE FLOAT(126)
System.String VARCHAR(255) VARCHAR(255) VARCHAR2(255)
System.DateTime DATETIME DATETIME TIMESTAMP(9)
System.Decimal NUMERIC(20,10) NUMERIC(20,10) NUMBER(20,10)
System.Guid UNIQUEIDENTIFIER VARCHAR(40) VARCHAR2(40)
Byte[] IMAGE LONGBLOB BLOB

For more information about the other supported backends, check out the Database Specifics section: