Introduction
This article describes a very simple wrapper class for SQLite. This class provides only few simple functions: opening and closing database, returning the list of tables and executing queries. Although these are basic functions, they are enough for someone who needs only a storage engine for his/her program.
Background
While writing this class, I've been using ADO.NET Data Provider for SQLite as a reference, which I found here.
Using the Code
Using this class is very easy: add a reference to this DLL (Project->AddReference...) in your project and a line to your code:
using SQLWrapper;
Now you can start using database functions in your program.
Example:
SQLiteBase db = new SQLiteBase("test.db");
DataTable table = db.ExecuteQuery("SELECT * FROM table1 WHERE id = 1;");
db.CloseDatabase();
Source Code
There are two constructors and and five public functions:
OpenDatabase
CloseDatabase
GetTables
ExecuteNonQuery
ExecuteQuery
which are all well-documented in the source file, so I don't see a point in explaining them again.