(C #) SQLite database connection string
14:49:35| Category:APP develop|Font Size Subscription
Basic) Data Source = filename; version = 3;
Using UTF16(Use UTF16 encoding) Data Source = filename; version = 3; useutf16encoding = true;
With password (with password) Data Source = filename; version = 3; Password = mypassword;
Using the pre 3.3x database format(Use the database format before 3.3x) Data Source = filename; version = 3; legacy format = true;
Read Only Connection) Data Source = filename; version = 3; read only = true;
With Connection Pooling (set connection pool) Data Source = filename; version = 3; pooling = false; Max pool size = 100;
Using datetime. ticks as datetime format () Data Source = filename; version = 3; datetimeformat = ticks;
Store guid as text (The GUID is stored as text, which is binary by default) Data Source = filename; version = 3; binaryguid = false;
More storage space is required if the guid is used as the text storage.
Specify cache size (specify the cache size)
Data Source = filename; version = 3; cache size = 2000;
The cache size is in bytes.
Specify page size (specify the page size) Data Source = filename; version = 2; page size = 1024;
Page sizeThe Unit is byte.
Disable enlistment in distributed transactions Data Source = filename; version = 3; enlist = N;
Disable create database behaviour (disable database creation)
Data Source = filename; version = 3; failifmissing = true;
By default, if the database file does not exist, a new one will be automatically created. Using this parameter will not create, but will throw exception information.
Limit the size of Database (Limit database size) Data Source = filename; version = 3; Max page count = 5000; The max page count is measured in pages. This parameter limits the maximum number of pages of the database.
Disable the Journal File(Disable log rollback)
Data Source = filename; version = 3; Journal mode = off;
This one disables the rollback journal entirely.
Persist the Journal File (persistent) Data Source = filename; version = 3; Journal mode = persist;
Connect to the SQLite database:
Data Source = mydb. DB; version = 3;
-- Possible value of "version": "2" indicates SQLite 2.x (default); "3" indicates SQLite 3.x
Connect to and create a new SQLite database:
Data Source = mydb. DB; version = 3; new = true;
Enable compression to connect to the SQLite database:
Data Source = mydb. DB; version = 3; compress = true;
Specify the cache size for connecting to the SQLite database:
Data Source = mydb. DB; version = 3; cache size = 3000;