A good day !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 IntegerParameter Binding: Users.SelectedItem.Relation.CompanyNumberI also uploaded my SQLDatabase (database.zip)
Hopefully you guys can help, i've been stuck on this issue for quite some time now.
https://www.dropbox.com/s/m1vhzwnl5oohg87/DatabaseDesign.JPGhttps://www.dropbox.com/s/nqfsr60lh7prnng/DatabaseDesign.vsdxhttps://www.dropbox.com/s/bt95ax3gvuhlc1p/DataCompany1.JPGhttps://www.dropbox.com/s/ijtshb8i26iz2z0/DataCompany2.JPGhttps://www.dropbox.com/s/ix7szyachef7hmt/ParameterBinding.jpghttps://www.dropbox.com/s/1otswlbcg0dk2ex/Query.jpghttps://www.dropbox.com/s/say1av10tleag99/UserSelection.jpghttps://www.dropbox.com/s/pbo8c008k15pit2/Database.zip