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.
Create a project from the
CH1_MyTasks
template and name itCh5_MyTasks_SQLiteClient
.Add the existing file
MyDatabase.sqlite
we created in the first recipe, Overview of SQLite Studio, and add it to the project root folder.Copy the
DBHelper.cs
file from the SQLite Client project in the new folderHelpers
.Add a project reference to the assembly
Community.CsharpSqlite.WP.dll
.Open the
App.xaml.cs
file and addusing
declaratives at the top of the...