简体   繁体   中英

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.

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.

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.

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.

Also: a SQL Server database (file) doesn't have a password mechanism like Access or other file-based system do. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM