SQLite C # winform connection string

Source: Internet
Author: User
Tags sqlite database throw exception
(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;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.