Part 7/11: Rapport with External Data Source – Database

Posted by in LightSwitch category on for Beginner level | Points: 250 | Views : 12979 red flag

This is the seventh part of the 11 series LightSwitch tutorial. In this part we will learn about how to work with the External Database

Table of Content

  1. Introduction
  2. Aim of the article
  3. Steps to connect to the External Database
  4. Conclusion


Rapid business application development is a need of today’s business and keeping that in focus software stewards wants to build the 3 tire applications at a lightning speed where there will be less code, less time will be spent on designing the UI screens , the BAL layer and DAL layer. By keeping all these into focus, on 26th July, 2011, Microsoft has released their new product – LightSwitch.

It is the simplest way for developers of all skill levels to develop business applications for the desktop as well as for cloud. This is the seventh part of the series of 12 LightSwitch tutorials where we will look into how to connect to the external database.

You can read the other parts of the LightSwitch tutorial as under

  1. Part 1: Introduction to Light Switch
  2. Part 2: Rapport with New Data Screen
  3. Part 3: Rapport with Search Data Screen
  4. Part 4: Rapport with Editable Grid Screen
  5. Part 5: Rapport with List and Details Screen
  6. Part 6: Rapport with Details Screen
  7. Part 7: Rapport with External Data Source – Database
  8. Part 8: Rapport with External Data Source – WCF RIA Service
  9. Part 9:Using a custom control in LightSwitch
  10. Part 10: Publish LightSwitch Application as Desktop application and host in local system
  11. Part 11: Publish LightSwitch Application as Web application


The article assumes that, we have LightSwitch 2011 installed in our system

Steps to connect to the External Database

Step 1: Click on "Attach to external Data Source"

Step 2: Next choose "Database" as the data source type

Step 3: Choose "Microsoft Sql Server" as the Data Source

Step 4: Enter the Server name and teh Database name and perform the test connection.

Step 5: Once the Connection testing succeedes, from the "Attach DataSource Wizard Screen" choose the appropriate database object and give an appropriate Data Source Name(say EmployeeData).

Step 6: Click on the Finish Button. We will find EmployeeData in the "Data Sources" folder under which whatever database objects we selected has appeared.

That's it.Now add a New Data Screen for adding some records and then a Search Screen for searching the records

Run the application. Add and search the records.


So in this part we have learn about how to work with the External Database.In the next article we will look into how to use WCF RIA Service as our data source.

Thanks for reading the article.Happy lightning with LightSwitch.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Niladri Biswas
Member Level: Platinum
Member Status: Member
Member Since: 10/25/2010 11:04:24 AM
Country: India
Best Regards, Niladri Biswas
Technical Lead at HCL Technologies

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)