https://www.connectionstrings.com/sqlite/

SQLite.NET

  • Basic

    Data 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 to control the connection pooling mechanism.

    Data Source=c:\mydb.db;Version=3;Pooling=True;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 to 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 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 the default value. Off means that the underlying OS flushes I/O's.

↯ Problems connecting?

Get answer in the SQLite Q & A forum

Finisar.SQLite ADO.NET Data Provider

  • Standard

    Data 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

  • Standard

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

.NET Framework Data Provider for ODBC

    • Use an ODBC driver from .NET

      Driver={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.

sqllite connectionstring setting的更多相关文章

  1. 基于SqlSugar的数据库访问处理的封装,支持.net FrameWork和.net core的项目调用

    由于我们有时候需要在基于.net framework的项目上使用(如Winform端应用),有时候有需要在.net core的项目上使用(如.net core的WebAPI),那么我们把基于SQLSu ...

  2. 使用C#对SQLLite进行操作

    1.数据库连接(常用连接方法,示例) 1). 添加引用: System.Data.SQLite.DLL .2). 打开或创建数据库文件: SQLiteConnection.CreateFile(fil ...

  3. 无需部署的轻量级数据库—SQLLite,使用Demo

    当有程序需要保存轻量数据,而又烦躁序列化到本地的不便,轻量级数据库—SQLLite是一个很好的选择,只需引用System.Data.SQLite.DLL,无需部署数据库,便可像拥有数据库一样保存数据, ...

  4. SqlLite ---.net连接数据库

    初识SqlLite ---.net连接数据库   SqlLite以小巧和嵌入式闻名,以前只是听说,现在终于忍不住要尝试下. 先下载ADO.NET2.0 Provider for SQLite,下载完后 ...

  5. SQLLite 简介

    [1] SQLite,是一款轻型的数据库,是遵守ACID的关系型数据库管理系统,它的设计目标是嵌入式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内 ...

  6. sqllite小型数据库的使用

    1.适用场景:免安装型数据库:数据量不大,本地化管理:不依赖其他第三方类库:2.具体使用方法:添加sqllite类库引用 数据库连接定义,数据库以文件形式存储在sqllitedb/solution.d ...

  7. 使用EFCore,手动创建SQLLite数据库

    有时候我们需要在代码中动态生成一个sqllite数据库文件,可以按照以下代码完成, static void Main(string[] args) { MyContext context = new ...

  8. 初识SqlLite ---.net连接数据库

    Sqlite 是一款轻量级的关系型数据库,以小巧和嵌入式闻名.以前只是听说,现在终于忍不住要尝试下.本文的初衷是为.net平台的使用者提供帮助. Sqlite有专门为VS2010开发的程序包,大家可以 ...

  9. [Umbraco] 自定义DataType中Data Editor Setting Type

    上一篇介绍了在定义Document Type中的属性时用到的Data Type,当使用dropdown list如何调用外部数据源,可以根据提供的数据连接字符串,sql语句就能实现你想要显示的数据. ...

随机推荐

  1. MongoDB导出与导入远程Linux服务器上的数据

    场景 将远程服务器A上的MongoDB数据库test下的集合people导入到服务器B数据库test的集合people_test下. 简单方案 先将A服务器数据导出,然后再执行导入到B服务器. 下面的 ...

  2. 收起.NET程序的dll来

    作为上床后需要下床检查好几次门关了没有的资深强迫症患者,有一个及其搞我的问题,就是dll问题. 曾几何时,在没有nuget的年代,当有依赖项需要引用的时候,只能通过文件引用来管理引用问题,版本问题,更 ...

  3. P1072 Hankson 的趣味题[数论]

    题目描述 Hanks 博士是 BT(Bio-Tech,生物技术) 领域的知名专家,他的儿子名叫 Hankson.现在,刚刚放学回家的 Hankson 正在思考一个有趣的问题. 今天在课堂上,老师讲解了 ...

  4. JDK、CGLIB、Javassist和ASM的动态代理使用对比

    动态代理是指在运行时,动态生成代理类.正如标题所示,能够提供动态代理的方式有很多.既然选择这么有很多,那么如何选择会更好呢? 带着这个疑问,我找到了Dubbo的作者--梁飞大神的一篇文章.文章中对四种 ...

  5. window下关闭占用端口使用

    怎么在window下关闭端口! 1:查看特定端口被占用情况 命令:   netstat -ano 和 netstat -ano|findstr 端口号 netstat -ano:查看电脑所有端口被占用 ...

  6. springboot集成thymeleaf中遇到不能反悔页面,只能反悔字符串

    错误:::::不能返回页面,只能返回字符串 原因::::在controller中使用了注解@RestController 修改注解为:@Controller 分析: RestController = ...

  7. 自定义创建vue文件代码块

    "vue-component": { "prefix": "vue-component", "body": [ &quo ...

  8. MenuOS扩展(课堂时间作业)

    MenuOS扩展实验 1.编译内核 2.制作根文件系统 rm menu -rf 强制删除原menu文件 git clone https://github.com/mengning/menu.git 从 ...

  9. Spring源码窥探之:BeanPostProcessor

    Spring的Bean后置处理器 1. 实体类 /** * @author 70KG * @Title: Train * @Description: * @date 2018/7/23下午11:31 ...

  10. placeholder这个属性 input

    input是一个很常见的标签,大家使用的也很常见,但是我在具体的工作中发现要想完美的使用这个标签还是任重而道远,下面是我碰到的几个问题. 1.我们在使用这个标签的时候会习惯的加上placeholder ...