实体框架代码优先:使用不需要单独安装的数据库?
我知道 SQL Server Express 将与 Code First 配合使用并且是免费的,但我的客户不喜欢额外的安装步骤。是否有其他我可以使用且无需单独安装的数据库?这只是一个单用户应用程序,所以我实际上并不需要强大的数据库......只需要存储和强制数据完整性的方法。
我自己做了一些研究,并提出了:
- SQLLite
- SQL Server Compact Edition 4
- MS Access
但是,如果我错了,请纠正我,这些都不适用于实体框架...有什么想法吗?
编辑:简而言之:我需要一个支持 EF 的嵌入式数据库。
I understand that SQL Server Express will work with Code First and is free, but my client doesn't like an additional install step. Is there any other database that I can use that won't need to be installed separately? This is just a single user application so I don't really need a powerful database... just need storage and a way to enforce data integrity.
I did a little research on my own and came up with:
- SQLLite
- SQL Server Compact Edition 4
- MS Access
However, and please correct me if I'm wrong, none of these work with Entity Framework... Any ideas?
EDIT: To put it short: I need an embedded database that supports EF.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
EF 支持 Sql Server CE 和 SqlLite。不支持 MS Access。支持的第三方提供的列表位于此处。我推荐使用 Sql CE。
编辑:
我认为你只需要安装 Sql Server CE 4.0 的工具,然后你就可以在连接字符串中定义数据库:
连接字符串的名称应该是派生上下文的名称。
Both Sql Server CE and SqlLite are supported by EF. MS Access is not supported. List of supported third party provides is here. I recommend using Sql CE.
Edit:
I think you only need to install tools fro Sql Server CE 4.0 and then you will be able to define database in connection string:
The name of the connection string should be the name of your derived context.
尝试这个教程。我发现它很容易遵循。
EF 代码首先使用 sql 紧凑
它适用于 asp.net mvc,但它是用 C# 编写的,应该足够简单以挑选出相关位
http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development -with-entity-framework-4.aspx
try this tutorial. I found it easy to follow.
EF code first with sql compact
It's for asp.net mvc, but it's in C# and should be simple enough to pick out the relevant bits
http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx