This is a very simple C# wrapper for SQLite 3. Only the essential API functions are supported (i.e. creating statements, binding parameters, executing statements).
Here's an example:
// Open the databaseSQLite.DBdb=newSQLite.DB("database.sqlite");// Create the statementSQLite.DB.Statementstmt=db.CreateStatement("SELECT * FROM dummy_table WHERE id = ?");// Bind the value 4 to the first parameterstmt.BindInt(1,4);// Execute the statement and receive an array of columns.// You can execute a statement multiple times, and bind// different values on the same parameterSQLite.Column[]result=stmt.Exec();if(result!=null){// If it's null, the query didn't return anything// Otherwise, there is at least one rowfor(inti=0;i<result.Length;++i){// Column namestringname=result[i].name;// Column typeSQLite.Column.Typetype=result[i].type;// Column values. Make sure to cast those to the correct type based on the column type:// INTEGER -> long// FLOAT -> double// TEXT -> string// BLOB -> byte[]// NULL -> 'values' is empty in this case, so no cast needed hereList<object>values=result[i].values;// Every column will have the same number of values,// which is also the number of rows.}}This wrapper was created by UnexomWid. It is licensed under the MIT license.