1. Create an empty SQLite database. // You can directly specify the suffix of the database name, even without a suffix
// Method 1: Create an empty SQLite database in Io Mode
Filestream FS = file. Create ("C: \ test. DB");
// Method 2: Use sqliteconnection
Sqliteconnection. createfile ("C: \ test. DB");
The created database is a 0-byte file.
2. Create an encrypted empty SQLite database // create an empty SQLite database with a password
Sqliteconnection. createfile ("C: \ test2.db");
Sqliteconnection CNN = new sqliteconnection ("Data Source = c: \ test2.db");
Sqliteconnection CNN = new sqliteconnection ("Data Source = D: \ test2.db");
CNN. open ();
CNN. changepassword ("password");
3. encrypt the unencrypted database sqliteconnection CNN = new sqliteconnection ("Data Source = c: \ test. DB");
CNN. open ();
CNN. changepassword ("password");
4. Open the encrypted SQLite Database
// Method 1
Sqliteconnection CNN = new sqliteconnection ("Data Source = c: \ test2.db");
CNN. setpassword ("password");
CNN. open ();
// Method 2
Sqliteconnectionstringbuilder builder = new sqliteconnectionstringbuilder ();
Builder. datasource = @ "C: \ test. DB";
Builder. Password = @ "password";
Sqliteconnection CNN = new sqliteconnection (builder. connectionstring );
CNN. open ();
Paging
Select * from messages limit 10,100;
This indicates that 10 rows are skipped and the returned results of 100 rows are taken.