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 5: Handling Data in LightSwitch Application

Feb 21 2013 12:00AM by Karthikeyan Anbarasan   

Introduction:

In this article, we are going to see how to Handle Data that is part of designing the Visual Studio Light Switch Application. In our previous article, we have seen how to design a table with a relationship normalized in order to have Relational Data structure in place. Handling Data in Visual Studio Light Switch Application is very critical as based on the data and design the front end UI screens are automatically created. We are restricted to do a code at the maximum in order to take advantage of the Visual Studio Light Switch Framework. Let us see the steps and in detail analysis on how to handle the data easily by creating a new Visual Studio Light Switch Application.

Steps:

Open Visual Studio 2012 IDE in an administrator mode and Create a new Visual Studio Light Switch Project or select the existing Light Switch project which we created in Part 4 of this series as shown in the screen below:

lightswitch project

In Visual Studio Light Switch Application, we have option to “Create a new Table” and create your own data or the other option is to “Attach to External Data Source” as shown in the screen below:

start with data

So here, we can see a Generic Option of “Attach to External Data Source”, so what data sources we can create? With Visual Studio Light Switch Application we can connect to below data sources of our choice,

  • To SQL Server Database
  • To SharePoint List
  • To OData Service
  • To WCF RIA Service

Let us take an example of how we can connect to an ODATA Service and accomplish the data interaction with the screen in this tutorial. Northwind provides a free OData service to access the data, which can be accessed using the URL http://services.odata.org/Northwind/Northwind.svc/. Let us use this service and access the data that we will use it in the application, which we are going to develop. Type the URL in the browser and we can see the data as shown in the screen below:

data screen

To start with, Right Click on the Data Source folder in the solution explorer and select Add New Data Source. A wizard opens as shown in the screen below:

attache data source wizard

Select the ODATA Service data source from the list available and Click on the Next button to proceed further to the next step as shown in the screen below:

OData Service

Now specify the ODATA Service URL (Northwind database URL - http://services.odata.org/Northwind/Northwind.svc/) and click on Next button as shown in the screen below. If the service needs any authentication procedure, provide the necessary details and click on the Next button.

connection information

Next step is to select the Entities that is been listed, here we have a single Entity. Click on the entity checkbox and specify a new datasource name as shown in the screen below:

choose entities

Now click on Finish button and we can see the list of tables and the columns that are available for each of the tables as shown in the screen below:

list of tables and columns

Now the process is the same as we discussed in our earlier article. Just add a new screen from the list of available templates as per the requirement and select the appropriate table to get the data feed and uses it accordingly as shown in the screen below.

connection list details

Conclusion:

Therefore, in this article we have seen how to handle data in Visual Studio Light Switch application by connecting to external datasource available services and design the application with the data.


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]