This sample shows you how to use LINQ to SQL to store relational data in a local database that resides in your app’s storage container.

In Windows Phone OS 7.1, you can use LINQ to SQL to store relational data in a local database that resides in your app’s isolated storage container. This sample is a to-do list app that uses a multi-table local database. Items that appear in the list are added, updated, and deleted from a local database, where they persist between app launches. For info about how to develop this app step-by-step, see How to create a local database app with MVVM for Windows Phone.

You need to install Windows Phone SDK 7.1 to run this sample. To get started, go to the Windows Phone Dev Center.

Note:

When the app launches for the first time, no to-do items appear in the list. Isolated storage is not persisted between launches of Windows Phone Emulator. Run the app on a Windows Phone OS 7.1 device to observe data being stored in the database between app launches.

This sample includes the February 2011 version of the Silverlight for Windows Phone Toolkit. For the latest version of the toolkit and more info, see the Silverlight Toolkit website on Codeplex.

Note:

This sample is packaged as a Windows Phone 7.5 project. It can be converted to a Windows Phone 8 project, by changing the target Windows Phone OS version of the project. To create a Windows Phone 8 project, you must be running the Windows Phone SDK 8.0 on Visual Studio 2012. You can download the latest version of the SDK from http://dev.windowsphone.com/downloadsdk.

To convert the sample to a Windows Phone 8 project:

  1. Double-click the .sln file to open the solution in Visual Studio.

  2. Right-click the project in the Solution Explorer and select Properties. This opens the Project Properties window.

  3. In the Application tab of the Project Properties window, select Windows Phone OS 8.0 from the Target Windows Phone OS Version dropdown. A dialog will appear asking if you want to upgrade this project to Windows Phone OS 8.0.

  4. Select Yes to upgrade the project.