How to: Add a Database Project to a LightSwitch Application


For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

If you add a database project to your LightSwitch solution, you can write scripts that update the intrinsic database for your application when you build or deploy it. For example, you can populate a table with data when you deploy the application or change the schema of a database that you've already deployed.

To add a database project

  1. In Solution Explorer, open the shortcut menu for the Solution node, choose Add, and then choose New Project.

  2. In the Add New Project dialog box, choose the SQL Server node.

  3. In the project list, choose SQL Server Database Project.

  4. In the Name text box, enter a name for the project, and then choose the OK button.

To associate a database project

  1. In Solution Explorer, expand the LightSwitch Application node, open the shortcut menu for the Properties node, and then choose Open.

  2. On the General Properties tab, in the SQL Database Project list, choose the database project.

    System_CAPS_ICON_note.jpg Note

    You might need to wait while LightSwitch creates the associations.

Managing the Intrinsic Database
Walkthrough: Managing Data in a LightSwitch Application