How to Connect to Data
In LightSwitch, we can easily connect to existing data or to data tables that we create.
To provide data to a LightSwitch application, we can either connect to an existing data source such as a SQL Server database, or we can create tables in the SQL Server Express database that is included in LightSwitch.
We can connect to data by connecting:
- through a SQL Server Database
- to a SharePoint List
- to an Open Data (OData) Service
- to a Windows Communication Foundation (WCF) Rich Internet Application (RIA) Service
We can then use this data to create screens and queries in Visual Studio LightSwitch 2012.
How to Connect to a SQL Server Database
Step 1
Open the Solution Explorer.
Image 1

Step 2
In the Solution Explorer, click on the "Data Sources" option.
Image 2

Step 3
On the Project Menu, click on Add Data Source option.
Image 3

Step 4
The Attach Data Source Wizard appears.
Image 4

Step 5
Choose a Data Source Type, in other words from where the application gets the data, then click on the "Database" option and then click "Next".
Image 5

Step 6
The "Choose Data Source" dialog box appears.
Image 6

Step 7
Click on "Microsoft SQL Server" and click on the "Continue" button.
Image 7










Gowtham RajamanickamPosted Apr 13, 2016, 7:18 AM
nice article