Getting Started With Visual Studio LightSwitch 2012

Visual Studio LightSwitch 2012 is a tool that is a part of Visual Studio 2012 using a project template. It can be very useful and handy when you're building CRUD based database applications where you don't even need to write a single line of code. It will build nice clean looking screens and do most of the work for you. 

In this article, we will learn how to begin to work with LightSwitch 2012. We will also create a project using a Visual Studio LightSwitch template and will see how to load data in an Editable DataDrid.

Getting Started

  1. Open Visual Studio 2012.
  2. Go to "File" => "New" => "Project..."
  3. Select "LightSwitch" in installed templates.
  4. Select "LightSwitch Application (Visual C#)".
  5. Enter the Name and choose the location.
  6. Click "OK".


Image 1.


Image 2.

Now click on "Attach to external Data Source"


Image 3.

Now chose a data source type, I am selecting database and click the "Next" button.


Image 4.

Now chose database objects, for my sample I am selecting a customers table and click the "Finish" button.


Image 5.

This is the structure of the data source, here you can change the type and required.


Image 6.

Now add a new screen.


Image 7.

Select a screen tamplate "Editable Grid Screen" and supply the screen name. Select Screen Data from the dropdownlist and click the "OK" button.


Image 8.


Image 9.

Now run the application.


Image 10.