Lightswitch Datasource views missing from list

2019-07-23 15:23发布

I just started using Lightswitch 2013 and I have created a new view in my SQL Server 2012 database but cannot see it in Lightswitch when I go to refresh the datasource. Do I have to refresh some sort of cache or something?

ALTER VIEW viw_Months 
AS 
     SELECT DISTINCT MonthKey, MonthName FROM dbo.dim_Time

The Dim.Time table has a primary key on the DateID field.

1条回答
戒情不戒烟
2楼-- · 2019-07-23 15:49

Maybe the problem was your view doesn't have candidate column to be primary key :

LightSwitch must be able to infer a primary key for the view so that one row can be distringuished from another. If all of the view's columns are nullable then a primary key cannot be inferred and LightSwitch will not let you select it to be imported.

[social.msdn.microsoft.com : update datasource -> a particular view does not show up in list to add it to project]

Related SO Question : How do I get MS LightSwitch to recognize my View?

查看更多
登录 后发表回答