I'm having some issues with my sql database design… i think.
Im starting out on building my first application using Visual Studio Lightswitch (C#), together with a sql database in sqlexpress.
The problem i have with it, is a parameter/query, to filter my data correctly.
But i don't know if it is a database design issue, or just the wrong parameter i'm using.
I have created a screen in the lightswitch application called: Relations. (by just inserting the table: relations. And adding all tables relating to Relations).
In the Relations Screen, i have added 2 Relations, and 2 computers and 2 users corresponding to that Relation. (See attachment, DataCompany1 & DataCompany2)
When opening the Workstation Details, i want to be able to add a user that works at the company the computer is being used. (See attachment: UserSelection)
I have made a query/parameter in the WorkstationDetails view, but it is still not filtering the 'Users' only belonging to the company the 'Workstation' is being used.
Query: Where Workstation.Relation.CompanyNumber = Parameter(CompanyNumber)
Parameter: CompanyNumber of type Short Integer