Saturday, April 9, 2011

Visual studio Lightswitch Step by Step – Part 3

Using Multiple Datasources
In this post, we’ll add another datasource to the project created and use the tables in the new datasource in our application.
  • In the solution explorer, right click datasources and select add data source

  • Select Database from the options and click next.

  • You can select the database in an existing DB and add the tables from that DB to the project. In this sample, I have added the Products table and data from a local database to the project.


  • Once you have added the table to the project, you can edit the properties to fit your application requirements. I have changed the datatype for the Price field to Money in the products table.

  • You can change the details of a field in the table by using the property pages as given below.

  • Let’s now create a detail screen to see the data from the data source we have added to the application. For that create a new List and details screen as given below.

  • Run the application and you can see the product details from the database in the application.

No comments: