Nico's digital footprint

I grew up in the nineties, that makes me awesome by default

Building a basic Lightswitch application

 

Microsoft LightSwitch is an IDE that can build business applications without writing any code. The screens are generated from the data that is used. In this small article I will walk you through creating a simple application.

 

First some information about LightSwitch. LS builds 3-tier applications, the interface is build using Microsoft Silverlight in combination with WCF RIA services and Entity Framework, the default datastore for LS is SQL server express. LS also supports data from SQL Azure, MS Sharepoint and SQL server. As for language, support for Visual Basic and C# is build in. LS is currently in its second beta version, a full release is scheduled for end of 2011.

 

I’m going to create an application that lists superheroes, their owner, powers and city of operations. I will not use an existing database, so LS will use a newly created SQL server express DB.
My development machine is running Windows 7 professional 64-bit with Visual Studio 2010 enterprise and sql server express 2008 R2.

 

Naturally we kick this off by starting a new project in VS2010 so go to File > New > Project, select Lightswitch as projecttype and select a C# Lightswitch project. Give it a name and click OK.


project selection(Click to enlarge)

After the project finishes loading we find ourselves in the very minimalistic interface that is Microsoft Lightswitch, we only have 2 options on the start screen, Create new table or Attach to external data source. These options speak for themselves, create new table creates a new sql server express database for this project, attach to external data source allows you to connect to a sql database, a sharepoint  database or a sql azure database. We will create a new database for our superhero collection, so select Create new table.


initial screen(click to enlarge)

 

This opens up a graphical table design, start by naming the table and add columns like in the screenshot. In the properties of the ID column deselect the Display by default checkbox, this makes sure that the ID field isn’t shown in the application.


initial screen
(click to enlarge)

 

Create 2 more tables, City and Owner, make them like the screenshots below.


initial screen(click to enlarge)

initial screen(click to enlarge)

Next Page -->

  Log in

About the author

Hi,

My name is Nico, I’m an MCP living in Belgium.
I’m currently employed as a consultant in the Mobile Solution Center at RealDolmen, one of Belgium’s leading IT single source providers, where I focus on Windows Phone and Windows 8 development.

I'm also founding member and board member of the Belgian Metro App Developer Network, a user group focussed on Windows 8 and Windows Phone development. If you're in Belgium feel free to drop by if we're doing an event. http://www.madn.be

Since June 2012 I'm a proud member of Microsoft's Extended Experts Team Belgium. And in February 2013 I became a member of DZone's Most Valuable Bloggers family.

This blog will be about Windows Phone 7, C#, XNA , WPF, Silverlight, and much more!

I hope to get feedback from my readers either through comments, mail (nico_vermeir@hotmail.com), twitter, facebook, …

 

 

MeetLogo

 

MVBLogo

mybook

 

mybook

 

Month List