Bagikan melalui


How to: Add a Table to the LightSwitch Internal Database

You can add tables to the LightSwitch internal database. Conversely, you cannot add tables or other abstractions to external data sources such as a SQL Server database, SharePoint list, or WCF RIA Service by using LightSwitch. For those data sources, LightSwitch generates entities that match the structure of the data source.

For more information, see Data: The Information Behind Your Application.

link to video For a related video demonstration, see How Do I: Define My Data in a LightSwitch Application?.

To add a table to the LightSwitch Internal Database

  1. In Solution Explorer, click the Data Sources node.

  2. On the Project menu, click Add Table.

    A new table is opened in the data designer.

    In Solution Explorer, LightSwitch creates a node that represents the LightSwitch internal database. By default, the name of the node is ApplicationData. The following illustration shows the ApplicationData node in Solution Explorer.

    Intrinsic database

  3. In the Data Designer, at the top of the new table, double-click the name of the table, and then type a new name.

  4. Define the fields of the table. For more information, How to: Define Data Fields.

See Also

Tasks

How to: Define Data Fields

How to: Connect to Data

How to: Add a Computed Field

How to: Create a Drop-Down List of Values for a Field

How to: Validate Data

Other Resources

Data: The Information Behind Your Application

How to: Apply Constraints to Entity Fields