How to Modify and Delete a Relationship in LightSwitch Visual Studio 2012

How to Modify the Existing Relationship

In my previous article I described how to add a relationship between two tables in the LightSwitch internal database (http://tempuri.org/tempuri.html).

Now in this article I use the data designer in LightSwitch to modify or delete a relationship.

Use the following procedure to modify the exising relationship.

Step 1

Open the Solution Explorer.

Image 1

relation solex.jpg

Step 2

In the Solution Explorer, open one of the tables that we are using in the relationship, and then choose "Open".

Image 2

relationopen.jpg

Step 3

In the Data Designer, a relationship between the two tables appears.

Image 3

outputrelation.jpg

Step 4

Choose the navigation property that represents the relationship to another table.

Image 4

relationshipoutput.jpg

Step 5

The Property Window appears.

Image 5

relationprop1.jpg

Step 6

In the Property Window choose the Edit Relationship Property link.

Image 6

relationprop1.jpg

Step 7

The Edit Relationship dialog box appears.

Image 7

editrelationdialog.jpg

Step 8

Now you can edit the relationship between the two tables and click "OK".

Deleting a Relationship

Step 1

Open the Solution Explorer.

Image 1

relation solex.jpg

Step 2

In Solution Explorer, open one of the tables that we are using in the relationship, and then choose "Open".

Image 2

relationopen.jpg

Step 3

In the Data Designer, the relationship between the two tables appears.

Image 3

relationshipoutput.jpg

Step 4

In the Data Designer, right-click on the connecting line that represents the relationship to another table.

Image 4

del.jpg

Step 5

Choose "Delete Relationship" and we have the following output:

Image 5

norelation.jpg

Up Next
    Ebook Download
    View all
    Learn
    View all