简体   繁体   English

如何保护ado.net实体在本地计算机上生成的数据库

[英]How to protect ado.net entity generated database on a local machine

I have a C# application in .net 3.5 using SQL Server 2008 R2. 我在使用SQL Server 2008 R2的.net 3.5中有一个C#应用程序。

I am using ado.net Entity Framework to generate the database but after generating it when I remove the database file from SQL Server the framework does not generate the database. 我正在使用ado.net实体框架生成数据库,但是当我从SQL Server删除数据库文件生成数据库之后,该框架不会生成数据库。

I want to generate database on users local machine while installation and have a password on database access and protect the data from being read or modified by a local user rather than my application. 我想在安装时在用户本地计算机上生成数据库,并在访问数据库时使用密码,并保护数据免遭本地用户而不是我的应用程序读取或修改。

So the question is how to achieve this with out encrypting the whole data? 因此,问题是如何在不对整个数据进行加密的情况下实现这一目标?

What is the parallels here? 这里有什么相似之处?

I don't think EF in .NET 3.5 was ever capable of creating a database at runtime. 我认为.NET 3.5中的EF无法在运行时创建数据库。

You'll have to either upgrade to .NET 4 and EF 5 or 6 to use code-first with migrations to handle this, or then you need to write some code to handle that situation yourself, in .NET 3.5. 您必须升级到.NET 4和EF 5或6才能在迁移中使用代码优先功能来解决此问题,或者在.NET 3.5中需要编写一些代码来自行处理这种情况。

Also: a SQL Server database (file) doesn't have a password mechanism like Access or other file-based system do. 另外:SQL Server数据库(文件)没有像Access或其他基于文件的系统那样的密码机制 Access to a SQL Server database is handled by the SQL Server itself by means of logins on the server, users on the database-level and permissions for those users. SQL Server本身通过在服务器上的登录,数据库级别的用户以及这些用户的权限来处理对SQL Server数据库的访问。

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

相关问题 如何以编程方式从ADO.Net实体模型创建数据库? - How to programatically create a database from an ADO.Net Entity Model? 您如何移动Ado.net实体数据库? - How can you move the Ado.net entity database? 我创建了一个ADO.NET实体,从数据库生成但我无法使用它? - I made an ADO.NET Entity, generated from a database but i cant use it? LazyLoading适用于通过ADO.NET实体模型生成的上下文 - LazyLoading applicable to context that generated through ADO.NET entity model 如何使用动态生成的ADO.NET实体数据模型代码进行单元测试 - How to Unit Test with Dynamically-Generated ADO.NET Entity Data Model Code 如何使用 ADO.NET 创建数据库触发器 - How to create a database trigger with ADO.NET 带有数据库和ADO.NET实体框架的.NET TDD - 集成测试 - .NET TDD with a Database and ADO.NET Entity Framework - Integration Tests 将ADO.Net实体数据模型向导连接到MySQL数据库 - Connecting ADO.Net Entity Data Model Wizard to MySQL database ado.net实体框架4.1数据库初始化错误40 - ado.net entity framework 4.1 error 40 on database initialization Postgres数据库在ADO.NET实体数据模型中不可用 - Postgres Database not available in ADO.NET Entity Data Model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM