Share via

Entity Framework (SQL Server Compact)

SQL Server Compact provides Entity Framework support for the Web Application platform starting with SQL Server Compact 4.0. For more information about Entity Framework and how to get it see, Data Developer Center.

Limitations of the SQL Server Compact when used with the Entity Framework

  • SQL Server Compact 4.0 supports entities with server-generated values, but only for identity columns. If your model maps to non-identity columns with server-generated values, a "Not supported" exception is thrown.

  • SQL Server Compact 4.0 does not support schemas with duplicate constraint names.

    In SQL Server Compact, the constraint names are unique within a table and this can allow duplicate constraint names in the database. The behavior is different from SQL Server, where the constraint names are unique across the database. If a SQL Server Compact 4.0 schema has duplicate referential integrity (primary key – foreign key relationship) constraint names, the generation of the Entity Data Model using the Entity Data Model Wizard will fail. You should always keep the constraint name unique across the database, like by adding the name of the table to the constraint name.

  • SQL Server Compact does not support DISTINCT in aggregates (max, min, sum, count).

  • SQL Server Compact does not support command time-outs when it is used with the Entity Framework.

  • SQL Server Compact supports only Unicode strings.

  • SQL Server Compact does not support stored procedures and views.