Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

this series will help you starting with LightSwitch

Authors

Getting Started with Visual Studio LightSwitch

Getting Started with Visual Studio LightSwitch - Part 4: Working with Tables in LightSwitch Application

Feb 14 2013 12:00AM by Karthikeyan Anbarasan   

Introduction:

In this article we are going to see how to work with Database and Tables to store the data and manipulate it in Visual Studio Light Switch Application. In our earlier article, we have seen the different screen templates that are available with the Light Switch application and also saw some examples on how to use the same. In our earlier article we have seen the step by step approach on creating a Visual Studio Light Switch Application where we created a simple table to store the data. With this tutorial we will see how we can make use of most of the available options to create and manipulate a table for a Visual Studio Light Switch Application.

Steps:

Open Visual Studio 2012 IDE in administrator mode and create a new LightSwitch Project as shown in the screen below.

new lightswitch project

Now follow the steps from the Part 2 of this series and create a simple application which get the data and save it to the database table as shown in the screen below.

create table

This application is a simple Light Switch app which gets the students data and save it to the table which we created. The table structure looks like below.

table structure

Now let us use some of the features of the Light Switch Create table screen, like we will add a dependency relationship for the department as we need to specify which department the students belong to. To start with first right click on the Application Data folder in the solution explorer and click Add Table and create a new DepartmentTable as shown in the screen below.

create new table

Now go to the let us add the data for the DepartmentTable by simply creating a List screen and add 2 to 3 departments as shown in the screen below. To add just right click on the Screen folder in solution explorer and select the appropriate screen.

adding data in screen

Now we added few data as Department let us use this in our Student table, to do that open Student table in the designer view and click on Relationships and add the Many to 1 relationship between Student and Department tables as shown in the screen below.

adding relationship

Now right click on the Screen folder and create a new Screen which is List and details view with selecting the Students Table as the data source as shown in the screen below.

select screen template

We are done with our design and we can execute the project and we can see the relationship between the 2 tables in a form of a combo box which holds the department details as shown in the screen below.

combo box

We can do any number of relationships between the tables and get a good normalized solution in place for the application which we are architecting with Visual Studio Light Switch application development. Once we select the relationship value and add it to the table it looks a normalized way of handling the relationship between the tables added neatly as shown in the screen below.

relationship between table

Conclusion:

So in this article we have seen how to develop a Visual Studio 2012 Light Switch application which is having a relational data splitted across 2 different tables.


Karthikeyan Anbarasan
52 · 4% · 1176
0
Liked



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]