SQLite database connection string (C #)

Source: Internet
Author: User
Tags connection pooling sqlite database throw exception

Basic (Base)Data Source=filename; version=3; Using UTF16(using UTF16 encoding) Data Source=filename; version=3; Useutf16encoding=true; with password (password)Data Source=filename; version=3; Password=mypassword; Using the pre 3.3xdatabase format (using the 3.3x pre-databases) 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=100; Using datetime.ticks as DateTime format ()Data Source=filename; Version=3;datetimeformat=ticks;  Store GUID as text (store GUID as text, binary by default)Data Source=filename; version=3; Binaryguid=false;

If you need more storage space 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 transactionsData 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, it will automatically create a new one, using this parameter, will not be created, but throw exception information

Limit the size of database ( limits the size of databases ) 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 ( disables 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;   Basic connection to SQLite database:

Data source=mydb.db; version=3;

Possible values for "Version": "2″ refers to SQLite 2.x (default);" 3″ refers to SQLite 3.x


Connect to create a new SQLite database at the same time:

Data source=mydb.db; version=3; New=true;

To enable a compressed connection to the SQLite database:

Data source=mydb.db; version=3; Compress=true;

Specify the cache size to connect to the SQLite database:

Data source=mydb.db; version=3; Cache size=3000;

SQLite database connection string (C #)

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.