[转]SQLite数据库连接方式

简介:

http://blog.csdn.net/ZF101201/archive/2010/05/26/5626365.aspx

 

SQLite.NET

Type:    .NET Framework Class Library

Usage:  System.Data.SQLite.SQLiteConnection

Basic

Data Source=filename;Version=3;

Version 2 is not supported by this class library.

 Using UTF16

Data Source=filename;Version=3;UseUTF16Encoding=True;

 With password

Data Source=filename;Version=3;Password=myPassword;

 Using the pre 3.3x database format

Data Source=filename;Version=3;Legacy Format=True;

 With connection pooling

Connection pooling is not enabled by default. Use the following parameters to control the connection pooling mechanism.

Data Source=filename;Version=3;Pooling=False;Max Pool Size=100;

 Read only connection

Data Source=filename;Version=3;Read Only=True;

 

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

Normally, GUIDs are stored in a binary format. Use this connection string to store GUIDs as text.

Data Source=filename;Version=3;BinaryGUID=False;

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

 

Specify cache size

Data Source=filename;Version=3;Cache Size=2000;

The Cache Size value measured in bytes

 

Specify page size

Data Source=filename;Version=3;Page Size=1024;

The Page Size value measured in bytes

 

Disable enlistment in distributed transactions

Data Source=filename;Version=3;Enlist=N;

 

 Disable enlistment in distributed transactions

Data Source=filename;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=filename;Version=3;FailIfMissing=True;

  Limit the size of database

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

This one disables the rollback journal entirely.

Data Source=filename;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=filename;Version=3;Journal Mode=Persist;

 

 Controling file flushing

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 that the underlying OS flushes I/O's.

2.Finisar.SQLite ADO.NET Data Provider

Standard

Data Source=mydb.db;Version=3;

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

 Create a new database

Data Source=mydb.db;Version=3;New=True;

  Using compression

Data Source=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=mydb.db;Version=3;Cache Size=3000;

 

3.SQLite3 ODBC Driver

Standard

DRIVER=SQLite3 ODBC Driver;Database=mydb.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;

 

.NET Framework Data Provider for ODBC

Bridging to SQLite3 ODBC Driver

This is just one connection string sample for the wrapping OdbcConnection class that calls the underlying ODBC Driver. See respective ODBC driver for more connection strings to use with this class.

DRIVER=SQLite3 ODBC Driver;Database=mydb.db;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;

 


本文转自火地晋博客园博客,原文链接:http://www.cnblogs.com/yelaiju/archive/2010/10/21/1857887.html,如需转载请自行联系原作者

目录
相关文章
|
存储 物联网 网络性能优化
|
前端开发 API UED
React 懒加载图片 Lazy Image
懒加载是一种优化技术,通过延迟加载不在视口内的图片,减少初始页面加载时间,提升用户体验。本文从基础概念入手,逐步探讨 React 中实现图片懒加载的常见问题、易错点及解决方案,并通过代码案例详细解释。
474 3
|
9月前
|
机器学习/深度学习 人工智能 算法
生物医药领域-分子对接SOTA模型洞察
该文介绍了分子对接的作用过程、应用场景及分类,总结了现有软件的核心内容与评估指标,并分析了KarmaDock、DiffBindFR和RosettaVS三种最新模型的细节、性能和应用领域。研究指出,未来应关注模型长板特征,开发超大规模虚拟筛选平台以提升药物发现效率。
|
弹性计算 数据库
阿里云服务器流量怎么计算的?公网内网出入流量都收费吗?
阿里云服务器内网流量免费,公网入方向流量免费,只有云服务器公网出方向产生的流量才收费
8041 0
阿里云服务器流量怎么计算的?公网内网出入流量都收费吗?
|
自然语言处理 小程序
ModelScope体验:自然语言推理模型应用
自然语言推理,即输入形如(前提句,假设句)的句子对数据,模型会给出该句子对应的自然语言推理标签(contradiction、entailment、neutral)以及相应的概率,从而反映出句子对之间的关系。本文以“达摩自然语言推理”模型为例,展示了如果调用ModelScope工具,并通过gradio将该功能部署为小程序的过程。
|
SQL 监控 大数据
优化AnalyticDB性能:查询优化与资源管理
【10月更文挑战第25天】在大数据时代,实时分析和处理海量数据的能力成为了企业竞争力的重要组成部分。阿里云的AnalyticDB(ADB)是一款完全托管的实时数据仓库服务,支持PB级数据的秒级查询响应。作为一名已经有一定AnalyticDB使用经验的开发者,我发现通过合理的查询优化和资源管理可以显著提升ADB的性能。本文将从个人角度出发,分享我在实践中积累的经验,帮助读者更好地利用ADB的强大功能。
308 0
|
数据采集 机器学习/深度学习 数据挖掘
Python基于波动率模型(ARCH和GARCH)进行股票数据分析项目实战
Python基于波动率模型(ARCH和GARCH)进行股票数据分析项目实战
|
分布式计算 Spark 大数据
Apache Spark中国技术交流社区历次直播回顾(持续更新)
Apache Spark中国技术交流社区,由阿里巴巴开源大数据技术团队成立,持续输出spark相关技术直播、原创文章、精品翻译,钉钉群内千人交流学习,欢迎加入。钉钉入群 https://qr.dingtalk.com/action/joingroup?code=v1,k1,jmHATP9Tk+okK7QZ5sw2oWSNLhkt2lCRvfHRdW7XhUQ=&_dt_no_comment=1&origin=11 更多视频和ppt资料请入群获得。
Apache Spark中国技术交流社区历次直播回顾(持续更新)
|
安全 网络安全
ISO/IEC 27001 信息安全管理体系认证
一、 信息安全管理体系标准业务介绍 1、 背景介绍   信息作为组织的重要资产,需要得到妥善保护。但随着信息技术的高速发展,特别是Internet的问世及网上交易的启用,许多信息安全的问题也纷纷出现:系统瘫痪、黑客入侵、病毒感染、网页改写、客户资料的流失及公司内部资料的泄露等等。
3049 0
|
运维 网络安全 Docker
docker报错ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule
docker报错ERROR: Failed to Setup IP tables: Unable to enable SKIP DNAT rule
1192 0