This article describes how to create a new data table in LightSwitch using Visual Studio 2012.Procedure for creating a new Data Entity in LightSwitch.Step 1Open the Solution Explorer in Visual Studio LightSwitch 2012.The Application consists of two the following folders:1. Data Sources: This stores all the entities.2. Screens: This is used to store all the screens.Step 2Right-click on Data Source and choose "Add Table".Another way to create a Table.The default table appears in the table designer as shown below.Step 3 Click on "<Add Property>" and add the following fields in the table along with their data types.Step 4Now we will add another table. The table appears in the table designer.To add a relationship between the two tables click on the "Relationship" button.The Add New Relationship dialog box appears on the screen.The dialog box consists of two sections, one is the "From" and the other is the "To" section.In the From section I have used the "Subject" table and in the "To" section I have used the "Student" table.Next is the Multiplicity section. In this section one Student can have many Subjects.The next option is "On Delete Behaviour"; this drop down list consists of the following two options:Restricted: Record in Student cannot be deleted, if there is any associated record present in the Subject Table Cascade Delete: If a record in the Student Table is deleted then delete all the associated records from the Subject Table.Once you have selected the tables and set the properties between the two tables then click "OK". A relationship will be established as shown below.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: