visual studio - SQL View is not showing up in LightSwitch HTML client project -
i use view instead of table data item in screen, view not showing in data source->applicationdata in my solution explorer. so, of course not showing in data item list during screen editing.
i using latest ide version: ms visual studio professional 2013, verison 12 update 4.
what did
a) created test table (the code show lightswitch did, used solution explorer create table)
create table [dbo].[testpersons] ( [id] int identity (1, 1) not null, [name] nvarchar (255) default ('') not null, [rowversion] rowversion not null, primary key clustered ([id] asc) );
b) created test view (i used sql server object explorer this)
create view [dbo].[testpersonview] select id, name [testpersons]
-> added test data on sql server object explorer , shown correctly.
i tried this
° explicit cast (lightswitch datasource views missing list)
create view [dbo].[testpersonview] select distinct cast(id int) id, cast(name nvarchar(255)) name [testpersons]
° explicit cast , not-null handling
create view [dbo].[testpersonview] select distinct isnull(cast(id int), 1) id, isnull(cast(name nvarchar(255)), '-') name [testpersons]
° refreshed main project
° closed visual studio
° rebuild server project
appendix, 20. nov 2014
° on other posts read "updating data source" or "importing view" function not available (anymore?) in project:
it looks views, added directly (localdb)\v11.0 on sql server object explorer not synced applicationdata object in solution explorer.
workaround views localdb project (lightswitch, html client):
- add db file /bin folder external data source server project, in solution explorer, selecting "add data source..."
- during process, ok if select views
- now, available
i happy hear better, views localdb beeing able use them during development phase. ugly have localdb data source , 2nd external data source points same db, access views.
Comments
Post a Comment