简体   繁体   English

实体框架6.1.3和SQL Server CE 4.0-代码优先设置密码以保护sdf文件

[英]Entity Framework 6.1.3 and SQL Server CE 4.0 - Code First Setup a password to protect sdf file

I am using Entity Framework 6.1.3 along with SQL Server CE 4.0 . 我正在使用Entity Framework 6.1.3SQL Server CE 4.0 Is there anyway to put a password on the generated sdf file the first time it is created? 无论如何,第一次创建生成的sdf文件时要输入密码吗?

 <connectionStrings>
    <add name="SQLCompactTest" connectionString="Data Source=|DataDirectory|SqlCeTest.sdf;Password=aaa;" providerName="System.Data.SqlServerCe.4.0" />
  </connectionStrings>

I try to add a Password field in my connection string but it does not add a password to the sdf file. 我尝试在连接字符串中添加密码字段,但没有将密码添加到sdf文件中。

Thank you. 谢谢。

Adding a Password field in the connection string DOES add a password to the created sdf . 在连接字符串中添加Password字段不会将密码添加到创建的sdf You just have to make sure the connectionstring is used by entityframework, which tripped me over. 您只需要确保实体框架使用了连接字符串,就让我感到震惊。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用实体框架连接到 SQL Server CE(.SDF 文件) - Using Entity Framework to connect to SQL Server CE (.SDF file) 实体框架代码的SQL Server Compact 4.0连接字符串首先? - SQL Server Compact 4.0 connection string for Entity Framework code first? 实体框架代码第一个模式与SDF文件,这真的可靠吗? - Entity Framework Code First Pattern with SDF file, Is this really reliable one? 在本地使用SQL Server CE和在生产实体框架代码上使用SQL Server 2008? - Use SQL Server CE Locally and SQL Server 2008 on Production Entity Framework Code First? SQL Server CE 4实体框架4.3.1代码优先区分重音和区分大小写的搜索 - SQL Server CE 4 Entity Framework 4.3.1 Code First accent-insensitive and case-insensitive search 使用实体框架代码优先方法将文件存储在 SQL CE 4 中 - Store file in SQL CE 4 using Entity Framework Code-First approach 首先从Entity Framework 6.1.3调用存储过程 - Call stored procedure from Entity Framework 6.1.3 code-first 如何使用密码保护* .sdf(sqlCE文件) - How to protect a *.sdf (sqlCE file) with a password 外部SQL服务器上的实体框架代码优先 - Entity Framework Code First on external SQL server 将CSV导入SQL Server CE SDF - Importing CSV to SQL Server CE SDF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM