Microsoft Jet DB 是否与实体框架一起使用? [英] Does Microsoft Jet DB work with Entity Framework?

查看:37
本文介绍了Microsoft Jet DB 是否与实体框架一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个论坛 这里 ,有人提到实体框架不适用于 Access (Jet DB - .mdb).但是,似乎有一个 Jet DB 提供程序,如此处

In this forum here , someone mentions that Entity Framework does not work with Access (Jet DB - .mdb). However it seems that there is a provider for Jet DB as described here

这让我认为使用实体框架我唯一需要的是在定义模型之前定义以下内容:

Which makes me think that the only thing I need with Entity Framework is to define the follwing before I define the models:

<connectionStrings>  
    <add name="ProductContext"
         providerName="Microsoft.Jet.OLEDB.4.0"
         connectionString="Source=C:mydatabase.mdb;Jet OLEDB:Database
                           Password=MyDbPassword;"/>
</connectionStrings> 

有谁知道 Entity Framework 是否可以与 Jet DB 一起正常工作,我想在我开始之前确保它可以正常工作,因为我的设计文档取决于这个事实.

Does anyone know if Entity Framework works fine with Jet DB, I want to make sure it does before I start since my design document depends on this fact.

谢谢

推荐答案

Entity Framework 不支持 OLEDB 连接,因此您的连接字符串将不起作用.让实体框架与 MS Access 协作实际上是不可能的.您需要转储设计的 MS Access 部分或实体框架部分.

Entity Framework does not support OLEDB connections, so your connection string will not work. It is practically impossible to get Entity Framework to collaborate with MS Access. You will either need to dump the MS Access part of your design, or the Entity Framework part.

使用 MS Access 最接近的是使用强类型数据集和 Linq-to-DataSet http://msdn.microsoft.com/en-us/library/bb386977.aspx

The closest you could get using MS Access is using strongly typed datasets and Linq-to-DataSet http://msdn.microsoft.com/en-us/library/bb386977.aspx

或者,考虑使用 SQL Express(它是免费的)http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx

Or, considering going with SQL Express instead (it's free) http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx

这篇关于Microsoft Jet DB 是否与实体框架一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆