.Columns General
SQLite much more simplistic data types compared to SQL. The datatype limitations can be cumbersome especially if you add time durations, dates etc as SQLite has very few built-in functions for these....
View ArticleDateTime
https://www.sqlite.org/lang_datefunc.html Reading DateTime In Select Statements You need to specify you want the value returning in a DateTime format or you can just get the year portion returned!...
View ArticleCreating Tables
Good Resources https://www.sqlite.org/lang_createtable.html An Example bool DatabaseSqlite::InitialiseDatabase(void) { System::Data::SQLite::SQLiteConnection ^Connection1; String ^sTemp; try { //-----...
View ArticleAdd new column
Adding a new column ALTER TABLE tbl_status ADD COLUMN status_default TEXT; This will cause an error if the column already exists. To check if a column already exists first you can use: PRAGMA...
View Articleuser_version Pragma
The user_version pragma gets or sets the user-defined version value that is stored in the database header. Following is the simple syntax: PRAGMA [database.]user_version; PRAGMA...
View ArticleCreate New Database
Create Database File Example #define SQLITE_DATABASE_FILE_PASSWORD "mypasswordgoeshere" bool DatabaseSqlite::CreateDatabase(void) { String ^FilePath; System::Data::SQLite::SQLiteConnection...
View ArticleINSERT Queries
INSERT Example String ^sTemp = "INSERT INTO myTable ( \ SomeValueColumn, \ SomeStringColumn \ ) Values ( \ @SomeValue, \ @SomeString \ )"; Command1->CommandText = sTemp; //Strings should be added...
View ArticleSELECT Queries
SELECT Query Example Command1->CommandText = "SELECT * FROM MyTable WHERE SomeColumnName >= @StartValue AND SomeColumnName <= @EndValue";...
View ArticleGROUP BY
IMPORTANT NOTE ABOUT GROUP BY The fields you get returned are not necessarily the fields from the exact same row in a collection of group by rows. This is relevant when you for instance want to get...
View ArticleDatabase is locked error
We've found this can happen if executing an update after a read on a sqlite database file. Tried all sorts of fixes, closing the connection in between, etc, etc, but nothing other than a long sleep...
View Article