EF4添加摘要数据库视图(只读)

时间:2012-03-29 13:20:23

标签: entity-framework-4 view

我正在使用EF4和SQL Server 2008.我在数据库中有一个摘要View,我试图通过Update Model from Database将它添加到edmx文件中。但是它在视图上要求主键时出错。但是我的视图没有主键并且只读 - 如何添加视图??

错误是

Message 6   The table/view 'SurveyReports.dbo.vw_responserate' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity, you will need to review your schema, add the correct keys, and uncomment it.   F:\SurveyReports\SurveyReports\SurveyReports\SurveyReports\DAL\Reports.edmx 0   0   SurveyReports

0 个答案:

没有答案