This is the first part of the 11 series LightSwitch tutorial . In this part we will learn about what LightSwitch technology is, what are its core components, it’s benefits.
Table of Content
- Introduction
- Aim of the article
- Download LightSwitch
- What is LightSwitch ?
- An overview of LightSwitch Screens
- Conclusion
Rapid business application development is a need of today’s business and keeping that in focus software stewards wants to build the 3 tire applications at a lightning speed where there will be less code, less time will be spent on designing the UI screens , the BAL layer and DAL layer. By keeping all these into focus, on 26th July, 2011, Microsoft has released their new product – LightSwitch.
It is the simplest way for developers of all skill levels to develop business applications for the desktop as well as for cloud.
LightSwitch comes with 5 predefined templates such as
- Details Screen
- Editable Grid Screen
- List and Details Screen
- New Data Screen
- Search Data Screen
By using the existing templates, we can build various forms and can connect to various data sources like SQL Server, SQL Azure, SharePoint etc. for populating the forms. We can even export data to Microsoft Excel without writing a single line of code as there is an internal integration between Microsoft Office and LightSwitch. Keep it simple, within less time and less coding, we can build business applications quickly by using this technology.
This article is aimed at the beginners who are new to LightSwitch, wants to have some hands on demonstration about the technology so that they can do a typical data oriented business application by using this technology. The article is divided into following parts
Part 1: Introduction to Light Switch
Part 2: Rapport with New Data Screen
Part 3: Rapport with Search Data Screen
Part 4: Rapport with Editable Grid Screen
Part 5: Rapport with List and Details Screen
Part 6: Rapport with Details Screen
Part 7: Rapport with External Data Source – Database
Part 8: Rapport with External Data Source – WCF RIA Service
Part 9: Using a custom control in LightSwitch
Part 10: Publish LightSwitch Application as Desktop application
Part 11: Publish LightSwitch Application as Web application
We can download the 90 days trial version from here
LightSwitch uses various underlying technologies to build its application. LightSwitch applications are based on Silverlight ,n-tire application layering , MVVM ,Entity Framework and WCF RIA Services . This ensures that, LightSwitch applications can be deployed as desktop applications as well as browser-based applications. It can even be hosted in Windows Azure.
LightSwitch concentrates about data and screens. The data in the screen is managed by a data workspace. This workspace is responsible for
- fetching entities from the provided data services in the middle tier via queries
- tracking changes
- sending updates back through the save pipeline to the middle-tier data service.
When we enter into the LightSwitch environment, we are welcome with the below screen

As can be seen that there are basically two empty folders, Data Source and Screens. The Data Sources folders are the containers where the data sources for the LightSwitch applications will reside. The UI screens needed for the application will reside in the Screens folder.
LightSwitch offers two kind of views –
- Logical View
- File View
Logical View
It is the default view of LightSwitch. In this view all the details are hidden and only the view that is needed for a LightSwitch developer to understand and start his/her work is presented. The figure above depicted the Logical View.
FileView
This view gives a detail look as how the LightSwitch project is organize.

In File View we can find the Client and Server projects. In case of LightSwitch the client runs under the Silverlight framework and the server under the.NET Framework 4.
We can write code in LightSwitch for entities, queries and screens. At the top of each designer we can find a “Write Code” drop-down button that displays the available methods e.g.

Here we can write validation, security rules, query processing logic etc. Some code that we write here runs on the server, some on the client side and some on both. Ideally LightSwitch does the job of running the code either on server or client.
As we have seen earlier that, there are 5 screens for LightSwitch. We will have a bird’s overview of those now
A. New Data Screen
From this screen, we insert records to the database
B. Search Data Screen
This Screen is use for searching the record that has been entered from the New Data Screen. In this screen, we have the option of saving the searched record into the excel file.
C. Editable Grid Screen
We can edit, save and update the records from this screen.
D. List and Details Screen
In this screen, we can the view the records both as list and details. Initially the records will appear as List and upon clicking on that, we can have a detail view of them.
E. Details Screen
If we have a Master-Child record and want to display the same, then the ideal choice will be this screen.
So in this part we have seen what a LightSwitch technology is, what are its core components, it’s benefits. Also we have discussed about the functionality of every screen. In the next article, we will look into the Data Entry Screen.
Thanks for reading the article.Happy lightning with LightSwitch.