最常用的: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. C# EF中调用 存储过程并调回参数

    TourEntities db = new TourEntities(); List<v_product> v = new List<v_product>(); SqlPara ...

  2. MyBatis学习之输入输出类型

    1.  传递pojo对象 Mybatis使用ognl表达式解析对象字段的值,#{}或者${}括号中的值为pojo属性名称,其中,#{}:占位符号,好处防止sql注入,${}:sql拼接符号, 简要说明 ...

  3. 使用Maven命令安装jar包到仓库中

    项目中可能会碰到很多jar包,使用maven update不能更新,或者jar包是拷贝过来,不能编译的情况.此时就需要手动使用命令行安装. 例如Demo项目中提示缺少四个jar包,但是在repo中已经 ...

  4. LeetCode 38 Count and Say(字符串规律输出)

    题目链接:https://leetcode.com/problems/count-and-say/?tab=Description   1—>11—>21—>1211—>111 ...

  5. vue 项目里正确地引用 jquery

    一.NPM安装的jQuery 使用vue-cli构建的vue项目,需要修改的是build/webpack.base.conf.js 1.添加引入webpack,后面的plugins那里需要 const ...

  6. rpm包安装失败的解决办法

    author: headsen  chen date :  2018-10-15  14:24:36 1,故障现象: # rpm -ivh zabbix-agent--.el6.x86_64.rpm ...

  7. 圆形CD绘制 (扇形)

    参考: Egret教程Arc是使用示例:http://edn.egret.com/cn/article/index/id/673 我封装的工具类: /** * 圆形进度 * @author chenk ...

  8. for,for-each,for-in,for-of,map的比较

    参考: 全面解析JavaScript里的循环方法之forEach,for-in,for-of Iterator 和 for...of 循环 JavaScript Array 对象 常规for for循 ...

  9. Android按钮事件的4种写法

    经过前两篇blog的铺垫,我们今天热身一下,做个简单的例子. 目录结构还是引用上篇blog的截图. 具体实现代码: public class MainActivity extends Activity ...

  10. iOS uitextfield长度限制

    [textUsername addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEd ...