Getting Started With LightSwitch 2011

This article describes how to load and edit data in an editable grid using LightSwitch 2011.

This article describes how to load and edit data in an editable grid using LightSwitch 2011.

What is LightSwitch? Microsoft Visual Studio LightSwitch is the best way to create high-quality business applications for the Desktop and the cloud.

Getting Started: First of all you need to install LightSwitch2011. You can refer to this link:

http://www.microsoft.com/en-in/download/details.aspx?id=26830

After installing start Visual Studio and create a new project and select a LightSwitch template and click on the LightSwitch Application (Visual C#) and click "OK".

img1.jpg

Image 1.

img2.jpg

Image 2.

As you can see there are two links, one to create a new database table and the second to attach to an external data source. Let's click on "Attach to external Data Source".

img3.jpg

Image 3.

Now click on "Database" and click "Next >".

img4.jpg

Image 4.

Select the server name and select the database, I am using the NORTHWND database in this article. Click OK.

img5.jpg

Image 5.

Select tables and click the "Finish" button.

img6.jpg

Image 6.

This is the diagram layout as you can see. In this article you can add a relationship if you are using more than one table and you can write a query to access the database and you can add a screen.

img7.jpg

Image 7.

Add a new screen now. Right-click on "Screens" and click on "Add New Screen".

img8.jpg

Image 8.

Here you can select a screen template and you can edit the screen name and you must select screen data and click "OK".

img8.1.jpg

Image 9.

In the screen designer you can delete any column and you can add a button.

Now let's run the application to see the output.

img9.jpg

Image 10.

As you can see there are many features available; paging, Add new item, delete an existing item and export records.

img10.jpg

Image 11.