Articles → Light Switch 2011 → Connect To External Database In Lightswitch 2011
Connect To External Database In Lightswitch 2011
Software Requirement
- Visual studio 2010 is installed on your machine.
- Visual Studio 2010 service pack 1 is installed on your machine.
- Microsoft Visual Studio Light switch 2011 is installed on your machine.
- Silverlight runtime version 4 or 5 is installed on your machine
Prerequisite Knowledge
- How to create a new project using visual studio?
- How to create database, tables etc. in MS SQL server?
- What are screens and entities in lightswitch?
- How to create a screen in lightswitch application?
Steps Of Execution
- Create a new project
- Create a new database
- Connect with the existing database
- Create a new screen
Create A New Project
Click to Enlarge
Create A New Database
Click to Enlarge
Connect With The Existing Database
- Right click on the ‘Data sources’ folder and click ‘Add Data source..’.
- A window appears as shown in figure below. From the window select ‘Database’ and click on next
Click to Enlarge
- A window appears to allow user to enter the database credentials.
Click to Enlarge
- Once the credentials are entered and database is selected click on Ok.
- Another window appears which displays the list of tables in the selected database (and views if any)
Click to Enlarge
- Click on Finish.
- A popup window appears for giving warning about the issues in data source
Click to Enlarge
- Click continue
- Data source is added in the project. See the screen shot below
Click to Enlarge
Create A New Screen
Click to Enlarge
Output
Click to Enlarge