Mango Sample: Local Database Part 1:2

image

Storing Windows Phone application data is a pretty normal requirement. If you want it to persist across sessions, or even phone reboots, you really have three options:

  1. Save to the Cloud
  2. Save to Isolated Storage
  3. Save to Local Database

Each is correct for certain scenarios. But in this article, I will ONLY walk through the Local Database. This is an enhanced version of SQL CE – meaning your SQL skills are an asset. And, if you don’t have them, they come quickly.

Option 1: Code-First

Basically, you are allowed to decorate your classes and when you interact with a Data Context, the schema of the database will be made to accommodate your classes.

Read the whole article here.