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

How to: Convert Views

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.

The purpose of this topic is to introduce you to the most specific remarks about the views conversion. The Entity Framework Conversion Wizard allows you to convert Entity Framework models with views. By default all entities representing views in the Entity Framework model are converted to domain classes without primary keys.

For example, consider the following Entity Framework data model that contains views (vProductAndDescription and vSalesPersonSalesByFiscalYear from the AdventureWorks database).

The Entity Framework Conversion Wizard will convert the original entities to domain classes without primary keys.

Setting Primary Keys for the Converted Views

If your RLINQ contains entities without primary keys and you try to execute queries against your domain model, then you will receive the following exception: Invalid object name 'voa_keygen'. Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'. at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery.

Telerik Data Access always needs to associate its persistent types with a primary key.

Furthermore, if your domain model contains an entity without a primary, you should see an error saying that your entity has no primary key specified in the Error List pane.

The most straightforward solution is to specify a primary key for the entities without primary key directly in the Visual Designer. For more information, please refer to How to: Work with Views and Classes Without Primary Key.