How to Consume OData Service in LightSwitch 2012

What is OData? OData is a standardized protocol for creating and consuming data APIs. OData builds on core protocols like HTTP and commonly accepted methodologies like REST. The result is a uniform way to expose full-featured data APIs. For more info read

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

Now click on "Attach to external Data Source" and select ODataService and click the "Next" button.

Image 1.

Now enter the connection information and specify the OData service endpoint and click the "Next" button.

Image 2.

Right now I am using a default OData service.

<service xmlns:atom="" xmlns:app="" xmlns=""xml:base="">
<collection href="Products">
<collection href="Categories">
<collection href="Suppliers">

Now choose your entities and click "Finish".

Image 3.

This is the designer:

Image 4.

Now add a screen and select a service name from the screen data.

Image 5.

Now finally run the application to see the product list.

Image 6.