Click here to Skip to main content
Click here to Skip to main content
Go to top

Simple C# Wrapper for SQLite

, 16 Aug 2007
Rate this:
Please Sign up or sign in to vote.
An article that describes lightweight C# wrapper for SQLite


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.


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.


// creates a new instance of SQLiteBase and opens database in file "test.db"
SQLiteBase db = new SQLiteBase("test.db");
// executes SELECT query and store results in new data table
DataTable table = db.ExecuteQuery("SELECT * FROM table1 WHERE id = 1;");
// closes the database

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.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer (Junior)
Croatia Croatia
No Biography provided

Comments and Discussions

| Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 16 Aug 2007
Article Copyright 2007 by fbelic
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid