.NET Compact Framework Data Provider for SQL Server Mobile

    • Standard

      Data Source=MyData.sdf;Persist Security Info=False;

        SQL Server Compact
    • How to specify the location of the SDF file

      Often times the .SDF database is not running in the current directory so it becomes necessary to programatically set the path to the SDF file. This is an example (.net C#) on how to do this when the SDF file is located in the same directory as the executing application.

      Data Source=" + System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\MyData.sdf;
      Persist Security Info=False;

        SQL Server Compact
    • Specifying the maximum database size

      The maximum size of the database is by default 128 MB. Override this by using the following connection string.

      Data Source=MyData.sdf;Max Database Size=256;Persist Security Info=False;

        SQL Server Compact
    • Specifying the maximum buffer size

      The largest amount of memory that can be in use before the server starts flushing changes to disk is by default 640 kB. Override this by using the following connection string.

      Data Source=MyData.sdf;Max Buffer Size=1024;Persist Security Info=False;

        SQL Server Compact
    • Encryption enabled

      Use this connection string to enable encryption on the database.

      Data Source=MyData.sdf;Encrypt Database=True;Password=myPassword;
      File Mode=shared read;Persist Security Info=False;

      The Encrypt Database="True" pair is really not necessary as the presence of the Password-parameter itself turns on encryption for the connection.

      SQL Server Compact
    • Exclusive access

      Use this one to disallow other processes from opening or modifying the database while you have it open.

      Data Source=MyData.sdf;File Mode=Exclusive;Persist Security Info=False;

        SQL Server Compact
    • Read only access

      Use this one to open a read-only copy of the database.

      Data Source=MyData.sdf;File Mode=Read Only;Persist Security Info=False;

        SQL Server Compact
    • Exclusive but shared for reading

      Use this one to allow other processes to read, but not modify, the database while you have it open.

      Data Source=MyData.sdf;File Mode=Shared Read;Persist Security Info=False;

        SQL Server Compact
    • Specifying the maximum temp file size

      The maximum size of the temporary database file is by default 128 MB. Override this by using the following connection string.

      Data Source=MyData.sdf;Temp File Max Size=256;Persist Security Info=False;

        SQL Server Compact
    • Case sensitive database

      Upon database creation the default is case insensitive, use this one for a case sensitive database.

      Data Source=MyData.sdf;Case Sensitive=True;Persist Security Info=False;

      This allows you to have multiple values, wich only deffer in lower / upper case, in a unique column.

      This setting is a database creation time option and is ignored when connecting to an existing database

.NET Compact Framework Data Provider for SQL Server CE的更多相关文章

  1. Data Provider 中没有.net framework Data provider for Mysql 的解决方法

    近来做的一个项目中,数据库用的是 MySql, 而在项目使用 Entity Data Model 来做数据服务层,可是在项目中添加 Data Entty Model 时,一般我们都会选择从数据库中直接 ...

  2. 解决VS2010在新建实体数据模型出现“在 .NET Framework Data Provider for Microsoft SQL Server Compact 3.5 中发生错误。请与提供程序供应商联系以解决此问题。”的问题

    最近想试着学习ASP.NET MVC,在点击 添加--新建项--Visual C#下的数据中的ADO.NET 实体数据模型,到"选择您的数据连接"时,出现错误,"在 .N ...

  3. SQL SERVER 遇到Unable to find the requested .Net Framework Data Provider. It may not be installed. (System.Data)

    今天新装的SQLSERVER 2012 EXPRESS 用于客户端程序 安装完成后打开登陆SQLSERVER 一切正常 当查看表定义.视图结构时,弹出一下内容 Unable to find the r ...

  4. 找不到请求的 .Net Framework Data Provider。可能没有安装.

    学习中遇到的问题: 找不到请求的 .Net Framework Data Provider.可能没有安装. 找到的解决方法 解决方法: 安装Microsoft SQL Server Compact 4 ...

  5. .Net Framework Data Provider可能没有安装

    方法一.下载SQL Server Compact 4.0 安装后就可以解决.下载地址是: http://www.microsoft.com/downloads/zh-cn/details.aspx?f ...

  6. 找不到请求的 .Net Framework Data Provider

    1.安装 mysql-connector-net-6.9.10.msi 2.修改C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine ...

  7. 解决“找不到请求的 .Net Framework Data Provider。可能没有安装.”错误

    问题: 这几天在装.NET 的开发环境,在装好VS2013和Oracle 11g之后,做了一个测试项目,运行调试没问题 但是涉及到数据库相关操作,如新建数据集.连接数据库等在调试的时候则会出现如下错误 ...

  8. CodeSimth - .Net Framework Data Provider 可能没有安装。解决方法

    今天想使用CodeSimth生成一个sqlite数据库的模板.当添加添加数据库的时候发现: .Net Framework Data Provider 可能没有安装. 下面找到官方的文档说明: SQLi ...

  9. CodeSimth - .Net Framework Data Provider 可能没有安装

    使用CodeSimth 连接SQLite数据库库 提示错误 codesmith 6以上的版本,说是支持sqlite生成,也有对应的sqliteprovider.dll,但是使用时却说Test fail ...

随机推荐

  1. Git权威指南 读笔(1)

    第四章 Git初始化: 设置Git当前用户和邮件地址: $ git config --global user.name $ git config --global user.email 设置Git命令 ...

  2. 在使用Fake framework的时候,为什么有一些函数没有生产mock呢?

    在使用Visual studio 2012 的Fake framework 做单元测试的时候,你会发现有一些函数没有生产Stub 或者 Shim的版本,这可能是由于Fake的一些限制导致的,但如何知道 ...

  3. 用JavaScript探测页面上的广告是否被AdBlock屏蔽了的方法

    每个人都讨厌广告.看电视.看电影.看优酷.看网页时,对满天飞的广告也是深恶痛绝.广告是一个不招人喜欢的东西.但是,对一个中小网站站长/博客主来说,广告几乎是唯一的能成支持网站/博客正常运转的资金来源. ...

  4. Java连接MySQl数据库实现代码

    1. 获取数据库连接和查询代码 package connectionmysql; import java.sql.Connection; import java.sql.DriverManager; ...

  5. Spatial Pyramid Matching 小结

    Spatial Pyramid Matching 小结 稀疏编码系列: (一)----Spatial Pyramid 小结 (二)----图像的稀疏表示——ScSPM和LLC的总结 (三)----理解 ...

  6. android fragment嵌套fragment出现的问题:no activity

    package com.example.fragmentNavigation2.fragment; import android.content.Context; import android.os. ...

  7. 李洪强实现横向滚动的View<一>

    今天做一个小的view的效果(纯代码),虽然这个view做起来 并不是很难,但是他是为后面我要实现的功能做一个铺垫. 01 创建CFTyreView,继承自UIView 02 来到.m文件. 2.1 ...

  8. C# SerializableDictionary序列化/反序列化

    说明:Dictionary对象本身不支持序列化和反序列化,需要定义一个继承自Dictionary, IXmlSerializable类的自定义类来实现该功能.感觉完全可以把这样的类封装到C#库中,很具 ...

  9. Linq的延迟

    书名:LINQ: The Future of Data Access in C# 3.0 Learn LINQ and the C# 3.0 Features That Support It http ...

  10. Android开发UI之补间动画-Tween Animation

    Tween Animation-补间动画 官网链接-http://developer.android.com/reference/android/view/animation/Animation.ht ...