SQLite. net

Source: Internet
Author: User
Tags utf 8
ArticleDirectory
    • Basic
    • In-Memory Database
    • Using UTF16
    • With Password
    • Using the pre 3.3x database format
    • With Connection Pooling
    • Read Only Connection
    • Using datetime. ticks as datetime format
    • Store guid as text
    • Specify cache size
    • Specify page size
    • Disable enlistment in distributed transactions
    • Disable enlistment in distributed transactions
    • Disable create database behaviour
    • Limit the size of Database
    • Disable the Journal File
    • Persist the Journal File
    • Controling file Flushing
    • Standard
    • SQLite version 2.x
    • Create a new database
    • Using Compression
    • Specifying cache size
    • UTF 8
    • UTF 16
    • Standard
    • Use an ODBC driver from. net
SQLite. net Type . NET Framework class library
Usage System. Data. SQLite. sqliteconnection
Manufacturer SQLite
More Info and class library downloads

Set example
Values basicData Source=C: \ mydb. DB;Version=3;

Version 2 is not supported by this class library.

In-Memory Database

An SQLite database is normally stored on disk but the database can also be
Stored in memory. Read more about SQLite in-memory
Databases here.

Data Source = : Memory: ; Version = 3 ; New = True ; Using UTF16 Data Source = C: \ mydb. DB ; Version = 3 ; Useutf16encoding = True ; With Password Data Source = C: \ mydb. DB ; Version = 3 ; Password = Mypassword ; Using the pre 3.3x database format Data Source = C: \ mydb. DB ; Version = 3 ; Legacy format = True ; With Connection Pooling

Connection pooling is not enabled by default. Use the following parameters
Control the Connection Pooling mechanic.

Data Source = C: \ mydb. DB ; Version = 3 ; Pooling = False ; Max pool size = 100 ; Read only connection Data Source = C: \ mydb. DB ; Version = 3 ; Read Only = True ; Using datetime. ticks as datetime format Data Source = C: \ mydb. DB ; Version = 3 ; Datetimeformat = Ticks ;

The default value is iso8601 which activates the use of the iso8601 datetime
Format

Store guid as text

Normally, guids are stored in a binary format. Use this connection string
Store guids as text.

Data Source = C: \ mydb. DB ; Version = 3 ; Binaryguid = False ;

Note that storing guids as text uses more space in the database.

Specify cache size Data Source = C: \ mydb. DB ; Version = 3 ; Cache size = 2000 ;

The cache size value measured in bytes

Specify page size Data Source = C: \ mydb. DB ; Version = 3 ; Page size = 1024 ;

The page size value measured in bytes

Disable enlistment in distributed transactions Data Source = C: \ mydb. DB ; Version = 3 ; Enlist = N ; Disable enlistment in distributed transactions Data Source = C: \ mydb. DB ; Version = 3 ; Enlist = N ; Disable create database behaviour

If the database file doesn't exist, the default behaviour is to create a new
File. Use the following parameter to raise an error instead of creating a new
Database file.

Data Source = C: \ mydb. DB ; Version = 3 ; Failifmissing = True ; Limit the size of Database Data Source = C: \ mydb. DB ; 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

This one disables the rollback journal entirely.

Data Source = C: \ mydb. DB ; Version = 3 ; Journal Mode = Off ; Persist the Journal File

This one blanks and leaves the Journal File on disk after a commit. Default
Behaviour is to delete the journal file after each commit.

Data Source = C: \ mydb. DB ; Version = 3 ; Journal Mode = Persist ; Controling file Flushing Data Source = C: \ mydb. DB ; Version = 3 ; Synchronous = Full ;

Full specifies a full flush to take action after each write. Normal is
Default Value. off means that the underlying OS flushes I/O's.

Finsar. SQLite ADO. NET data provider Type . NET Framework class library
Usage Finsar. SQLite. sqliteconnection
Manufacturer Finsar. SQLite
More Info
And class library downloads

Set example valuesstandardData Source=C: \ mydb. DB;Version=3;

The "version" key can take value "2" for SQLite 2.x (default) or value "3"
For SQLite 3.x

SQLite version 2.x Data Source = C: \ mydb. DB ; Version = 2 ; Create a new database Data Source = C: \ mydb. DB ; Version = 3 ; New = True ; Using Compression Data Source = C: \ mydb. DB ; Version = 3 ; Compress = True ; Specifying cache size

The cache size value represents the amount of data pages that are held in
Memory. Try increase this value for speed improvements but don't forget to keep
Track of the applications memory usage.

Data Source = C: \ mydb. DB ; Version = 3 ; Cache size = 3000 UTF 8 Data Source = C: \ mydb. DB ; Version = 3 ; Utf8encoding = True UTF 16 Data Source = C: \ mydb. DB ; Version = 3 ; Utf16encoding = True ; Sqlite3 ODBC driver Type . NET Framework class library
Usage
Manufacturer SQLite
More Info and class library downloads

set example
values Standard driver = sqlite3 ODBC driver ; database = C: \ mydb. DB ; longnames = 0 ; timeout =< SPAN class = "cs_v"> 1000 ; notxn = 0 ;
syncpragma = normal ; stepapi = 0 ;. NET framework data provider for ODBC type . net Framework Wrapper class library
usage system. data. ODBC. odbcconnection
manufacturer Microsoft
more info
and Wrapper class library downloads

Set example valuesuse an ODBC driver from. netDriver={Any
ODBC driver's name};Odbckey1=Somevalue;Odbckey2=Somevalue;

See the respective ODBC driver's connection strings options. the. NET
Odbcconnection will just pass on the connection string to the specified ODBC
Driver. Read more here.

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.