Book Image

Windows Phone 7.5 Data Cookbook

By : Ramesh Thalli
Book Image

Windows Phone 7.5 Data Cookbook

By: Ramesh Thalli

Overview of this book

Windows Phone 7.5 Mango contains support for apps written in Silverlight or XNA. These apps can store data on the device, and also load and manipulate data from "the cloud" and other web services.This Windows Phone 7.5 Data Cookbook has a range of recipes to help you apply data handling concepts. You will be able to apply the knowledge gained from these recipes to build your own apps effectively. This Windows Phone 7.5 Data Cookbook starts with data binding concepts at the UI layer and then shows different ways of saving data locally and externally in databases. The book ends with a look at the popular MVVM software design pattern. The recipes contained in this book will make you an expert in the areas of data access and storage.
Table of Contents (15 chapters)
Windows Phone 7.5 Data Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using SQLite as a local store for the MyTasks App


In this recipe let's explore how to use the SQLite file we created in the first recipe, Overview of SQLite Studio, as the local data store for our MyTasks app.

Getting ready

For this recipe we shall use the project template we created in the Chapter 1, Data Binding to UI Elements.

How to do it...

In the following steps, we will create a MyTasks project to use the sample SQLite database file we created in the preceding recipe and then learn how to use the SQLite Client API to insert and display the results.

  1. Create a project from the CH1_MyTasks template and name it Ch5_MyTasks_SQLiteClient.

  2. Add the existing file MyDatabase.sqlite we created in the first recipe, Overview of SQLite Studio, and add it to the project root folder.

  3. Copy the DBHelper.cs file from the SQLite Client project in the new folder Helpers.

  4. Add a project reference to the assembly Community.CsharpSqlite.WP.dll.

  5. Open the App.xaml.cs file and add using declaratives at the top of the...