Mango Sample: Local Database Part 1:2
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:
- Save to the Cloud
- Save to Isolated Storage
- 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.