Here we will see how to create a table, add a relationship and add a screen in a LightSwitch Application (Visual C#) in Visual Studio 2012.
The following is the procedure for adding tables and screens in LightSwitch.
Step 1Open the Solution Explorer.Step 2In the Solution Explorer, right-click on the Server and choose "Add Table". Step 3In this way we will add two tables.One is the Student Table.The other one is the Branch Table.Step 4Click on the "Add Relationship" button in the menu bar in order to add the relationship between the two tables.The relationship dialog box appears. From that dialog box select the tables and establish a one-to-many relationship between the Branch and Student table and click the "OK" button.The relationship will be established between the two tables.
Step 5In the Solution Explorer, right-click on the Screens and choose "Add Screen".Step 6The Add New Screen dialog box appears. Select the "Editable Grid Screen" from the Screen Template, under screen information, choose "Branches" under screen data and provide a name to the Screen and click the "OK" button.The screen designer appears for the Editable Branches Grid. In the same way we will add another "Editable Grid Screen" for the Student Table.The screen designer appears for the Editable Students Grid. Step 7Press F5 to run the application and provide some data to both the screens (Editable Branches Grid and Editable Students Grid).Editable Branches Grid Editable Students Grid
Printing in C# Made Easy