Skip to main content
Email Password   helpLost your password?

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:

// 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

db.CloseDatabase();

Source Code

There are two constructors and and five public functions:

which are all well-documented in the source file, so I don't see a point in explaining them again.

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralA possible alternative; NFileStorage Pin
snip1
7:54 17 Mar '09  
Generalcreate a database Pin
Chaozzster
7:28 16 Feb '09  
GeneralRe: create a database Pin
thk_sompi
13:16 1 Mar '09  
GeneralRe: create a database Pin
Ken Eucker
10:25 3 Jun '09  
GeneralRe: create a database Pin
fbelic
0:14 4 Jun '09  
GeneralRe: create a database Pin
Ken Eucker
22:19 4 Jun '09  
Generalout of memory Pin
saifsail
9:32 24 Jan '09  
GeneralPossible memory leak Pin
Jacky__E
4:34 24 Nov '08  
GeneralRe: Possible memory leak [modified] Pin
oren.shnitzer
11:21 22 Dec '08  
GeneralRe: Possible memory leak Pin
Jacky__E
4:16 23 Dec '08  
GeneralNo more memory leak Pin
Sten Hjelmqvist
3:19 23 Sep '09  
GeneralSame Error Pin
Member 3312055
9:50 21 Sep '08  
GeneralRe: Same Error Pin
Member 3312055
10:21 21 Sep '08  
Generalfacing some bug with your dll Pin
chal_adiera
23:42 27 Aug '08  
GeneralCan I use it in my Media Player? Pin
Sukhjinder_K
1:58 4 Jan '08  
GeneralVery Nice & Easy to Use Pin
Sukhjinder_K
22:22 15 Nov '07  
AnswerRe: Very Nice & Easy to Use Pin
Jacky__E
4:18 23 Dec '08  
GeneralThanks for this class Pin
flangset
1:02 29 Aug '07  


Last Updated 16 Aug 2007 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009