最常用的:Data Source=filename;Version=3;

自增主键:

Create  test1(
[id] integer PRIMARY KEY AUTOINCREMENT
,[name]   
);
Basic(基本的)
      Data Source=filename;Version=3;
Using UTF16(使用UTF16编码)
      Data Source=filename;Version=3;UseUTF16Encoding=True;
With password(带密码的)
      Data Source=filename;Version=3;Password=myPassword;
Using the pre 3.3x database format(使用3.3x前数据库格式)
      Data Source=filename;Version=3;Legacy Format=True;
Read only connection(只读连接)
      Data Source=filename;Version=3;Read Only=True;
With connection pooling(设置连接池)
      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(把Guid作为文本存储,默认是Binary)
     Data Source=filename;Version=3;BinaryGUID=False;

如果把Guid作为文本存储需要更多的存储空间

Specify cache size(指定Cache大小)

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

Cache Size 单位是字节

Specify page size(指定页大小)
      Data Source=filename;Version=3;Page Size=1024;

Page Size 单位是字节

Disable enlistment in distributed transactions
      Data Source=filename;Version=3;Enlist=N;
Disable create database behaviour(禁用创建数据库行为)

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 (禁用日志回滚

      Data Source=filename;Version=3;Journal Mode=Off;

This one disables the rollback journal entirely.

Persist the Journal File(持久)
      Data Source=filename;Version=3;Journal Mode=Persist;
 
 
基本连接Sqlite数据库:

Data Source=mydb.db;Version=3;

--"Version" 的可能值: "2″ 指 SQLite 2.x (default);"3″ 指 SQLite 3.x

连接同时创建一个新的Sqlite数据库:

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

启用压缩连接Sqlite数据库:

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

指定连接Sqlite数据库的缓存大小:

Data Source=mydb.db;Version=3;Cache Size=3000;

 

(C#) SQLite数据库连接字符串的更多相关文章

  1. C#连接SQLite的字符串

    一.C#在不同情况下连接SQLite字符串格式 1.Basic(基本的) Data Source=filename;Version=3; 2.Using UTF16(使用UTF16编码) Data S ...

  2. .NET跨平台之旅:数据库连接字符串写法引发的问题

    最近在一个ASP.NET Core站点中遇到一个奇怪问题.当用dotnet run命令启动站点后,开始的一段时间请求执行速度超慢,有时要超过20秒,有时甚至超过1分钟,日志中会记录这样的错误: Sys ...

  3. EF--Codefirst 加密数据库连接字符串

    http://www.tuicool.com/articles/QvYbEn 一.EF,CodeFirst加密SQL连接符 public LifeHelpContext() : base(" ...

  4. C# 根据ADO.NET数据库连接字符串构建EntityFrame数据库连接字符串

    为了保持开发效率,以及保持代码优雅,项目中引用了EntityFrame.但是又因为某些报表功能需要大量计算,所以又要求直接使用ADO.NET,调用存储过程进行计算. 于是乎webconfig文件中就会 ...

  5. 【转】ASP.NET数据库连接字符串总结

    来源:http://blog.csdn.net/lutinghuan/article/details/5973897 ASP.NET数据库连接字符串总结 一.使用OleDbConnection对象连接 ...

  6. web.config connectionStrings 数据库连接字符串的解释

    先来看一下默认的连接SQL Server数据库配置<connectionStrings>   <add name="LocalSqlServer" connect ...

  7. 获取不到app.config里面的数据库连接字符串的解决方法

    今天在自己的类库里添加了对app.config文件的数据库连接字符串的引用,但是返回的居然是Null,纳闷了.然后在网上找到了答案原来是我的app.config文件加错了地方,应该加到启动项目里面,而 ...

  8. [转]ASP.NET数据库连接字符串总结

    这个不难,而且很重要,但总忘,找了篇比较全的,作为资料. 原文链接http://developer.51cto.com/art/201107/275406.htm 关于数据库链接字符串的相关知识,我们 ...

  9. Enterprise Library 中加密数据库连接字符串

    看了SHY520写的关于Data Access Application Block的文章,写得不错,忽略了一点就是如何去加密数据库连接字符串,这儿我简单的介绍一下.我们知道,在Enterprise L ...

随机推荐

  1. QT开发之旅二TCP调试工具

    TCP调试工具顾名思义用来调试TCP通信的,网上这样的工具N多,之前用.NET写过一个,无奈在XP下还要安装个.NET框架才能运行,索性这次用QT重写,发现QT写TCP通信比.NET还要便捷一些,运行 ...

  2. syslinux 和 grub

    syslinux是一个功能强大的引导加载程序,而且兼容各种介质.它的目的是简化首次安装Linux的时间,并建立修护或其它特殊用途的启动盘.它的安装很简单,一旦安装syslinux好之后,sysLinu ...

  3. cocos2d-x-lua如何导出自定义类到lua脚本环境

      这篇教程是基于你的工程是cocos2d-x-lua的项目,我假设你已经完全驾驭cocos-x/samples/Lua/HelloLua工程,基本明白lua和c++互调的一些原理. 我们的目的是要在 ...

  4. 一个不错的工具推荐:JMeter

    在开发中可能会遇到一些场景需要对程序的性能,并发能力等进行度量,就是对一些程序的性能进行度量,生成一些报告等,最近遇到了一个不错的工具 apache JMeter,它是用java的swing开发的,功 ...

  5. node path的几个路径问题

    __dirname: 总是返回被执行的 js 所在文件夹的绝对路径 __filename: 总是返回被执行的 js 的绝对路径 process.cwd(): 总是返回运行 node 命令时所在的文件夹 ...

  6. [转]Android中attr自定义标签详解

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:wen= ...

  7. PHP-FPM子进程过少解决办法

    /usr/local/php/var/log/php-fpm.log报一下错误 server reached pm.max_children setting (5), consider raising ...

  8. POJ--1690 (Your)((Term)((Project)))(字符串处理)

    (Your)((Term)((Project))) Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 3353 Accepted: ...

  9. HDU-1166敌兵布阵(线段树)

    敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submissi ...

  10. ubuntu16.04下安装Sophus

    git clone https://github.com/strasdat/Sophus.git 下载完成后 cd Sophus git checkout a621ffmkdir buildcd bu ...