Getting Started With Visual Studio LightSwitch 2012

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

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".

img1.jpg

Image 1.

img2.jpg

Image 2.

Now click on "Attach to external Data Source"

img3.jpg

Image 3.

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

img4.jpg

Image 4.

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

img5.jpg

Image 5.

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

img6.jpg

Image 6.

Now add a new screen.

img7.jpg

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.

img8.jpg

Image 8.

img9.jpg

Image 9.

Now run the application.

img10.jpg

Image 10.