In practice, when I use Sqliteadmin and SQLite Expert Professional 2 software to create a new SQLite database in the asp.net is not used, always error: File is not a legitimate database. Later, a method is used to create a new database directly inside the asp.net using a referenced DLL.
String datasource = "D:\\test.db"; The address of the database file
System.Data.SQLite.SQLiteConnection.CreateFile (DataSource); Generate file
The resulting test.db can be used in asp.net, when you use Sqliteadmin and SQLite Expert Professional 2 software to open it in the inside of the table does not affect its use.
The operation of SQLite is very similar to access, but the beginning of OLE DB has become SQLite ...
. NET Framework Data Provider for ODBC
driver=SQLite3 ODBC DRIVER; database=mydb.db; 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. respective ODBC driver for the more connection strings to use with this class.
SQLite3 ODBC Driver
driver=SQLite3 ODBC DRIVER; database=mydb.db; longnames=0; timeout=1000; notxn=0; Syncpragma=NORMAL; stepapi=0;
Sqlite.net
Data source=filename; version=3;
Using UTF16 (using UTF16 encoding)
Data source=filename; version=3; useutf16encoding=True;
Data source=filename; version=3; password=mypassword;
Using the Pre 3.3x database format (use 3.3x Pre-database format)
Data source=filename; version=3; Legacy format=True;
Read Only connection (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=;
Using datetime.ticks as DateTime format ()
Data source=filename; version=3; datetimeformat=Ticks;
The default value is ISO8601 which activates the use of the ISO8601 datetime format
Store GUID as text (the GUID is stored as a literal and the default is binary)
Data source=filename; version=3; Binaryguid=False;
If you need more storage for the GUID as a text store
Specify cache size (Specify cache sizes)
Data source=filename; version=3; Cache size=2000;
Cache Size Unit is byte
Specify page size (Specify page sizes)
Data source=filename; version=3; Page size=1024;
Page Size Unit is byte
Disable Enlistment in distributed transactions
Data source=filename; version=3; enlist=N;
Disable Create Database behaviour (disable the creation of databases behavior)
Data source=filename; version=3; failifmissing=True;
By default, if the database file does not exist, a new one is created automatically, using this parameter, will not be created, but thrown 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 the 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;
This one blanks and leaves the journal file on disk after a commit. The Default behaviour is to delete the Journal File for each commit.
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 the underlying OS flushes I/O ' s.