In actual use, when I use SqliteAdmin and SQLite Expert Professional 2 software to create a new Sqlite database, it cannot be used in it, and I always report an error: the file is not a legal database. Later, one method was used, which was to directly use the referenced DLL to create a new database and then use it.
string datasource = "d:\\"; //The address of the database file
(datasource); //Create a file
In this way, the generated table can be used. At this time, even if you use SqliteAdmin and SQLite Expert Professional 2 software to open it and create tables in it, it will not affect its use.
The operation of Sqlite is actually very similar to Access, except that the ones at the beginning of OleDB have become SQLite...
string datasource = "d:\\"; //The address of the database file
(datasource); //Create a file
In this way, the generated table can be used. At this time, even if you use SqliteAdmin and SQLite Expert Professional 2 software to open it and create tables in it, it will not affect its use.
The operation of Sqlite is actually very similar to Access, except that the ones at the beginning of OleDB have become SQLite...
.NET Framework Data Provider for ODBC
DRIVER=SQLite3 ODBC Driver; Database=; LongNames=0; Timeout=1000; NoTXN=0;SyncPragma=NORMAL; StepAPI=0;
This is just one connection string sample for the wrapping OdbcConnection class that calls the underlying ODBC Driver. See respective ODBC driver for more connection strings to use with this class.
SQLite3 ODBC Driver
DRIVER=SQLite3 ODBC Driver; Database=; LongNames=0; Timeout=1000; NoTXN=0;SyncPragma=NORMAL; StepAPI=0;
Basic (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(Using pre-3.3x database format)
Data Source=filename;Version=3;Legacy Format=True;
Read only connection
Data Source=filename;Version=3;Read Only=True;
With connection pooling
Data Source=filename;Version=3;Pooling=False;Max Pool Size=100;
Using as datetime format()
Data Source=filename;Version=3;DateTimeFormat=Ticks;
The default value is ISO8601 which activates the use of the ISO8601 datetime format
The default value is ISO8601 which activates the use of the ISO8601 datetime format
Store GUID as text (store Guid as text, default is Binary)
Data Source=filename;Version=3;BinaryGUID=False;
If Guid is stored as text, more storage space is required
If Guid is stored as text, more storage space is required
Specify cache size (Specify the cache size)
Data Source=filename;Version=3;Cache Size=2000;
Cache Size unit is bytes
Data Source=filename;Version=3;Cache Size=2000;
Cache Size unit is bytes
Specify page size (specify page size)
Data Source=filename;Version=3;Page Size=1024;
Page Size Units are bytes
Page Size Units are bytes
Disable enlistment in distributed transactions
Data Source=filename;Version=3;Enlist=N;
Disable create database behavior
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, it will not be created, but will throw exception information.
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, it will not be created, 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)
Disable the Journal File (Disable log rollback)
Data Source=filename;Version=3;Journal Mode=Off;
This one disables the rollback journal entirely.
This one disables the rollback journal entirely.
Persist the Journal File
Data Source=filename;Version=3;Journal Mode=Persist;
This one blanks and leaves the journal file on disk after a commit. Default behaviour is to delete the Journal File after each commit.
This one blanks and leaves the journal file on disk after a commit. Default behaviour is to delete the Journal File after each commit.
Controling file flushing
Data Source=filename;Version=3;Synchronous=Full;
Full specifies a full flush to take action after each write. Normal is the default value. Off means that the underlying OS flushes I/O's.