O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Storing data in a SQLite database

It is quite difficult to imagine an application that uses a database but does not insert anything into it. Thus, it is crucial that you know how to store data in tables in the database. In this recipe, you will learn how to do it.

As an example, you will slightly modify the project from the previous recipe by adding the data of three categories while initializing the database.

Getting ready

To step through this recipe, you need the project from the previous recipe.

How to do it...

To modify the preceding example to add the data of three categories while initializing the database, modify the InitializeDatabase method in the MainViewModel class in the MainViewModel.cs file, as shown in the following code snippet:

 public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required