Microsoft Jet DB是否与Entity Framework配合使用? [英] Does Microsoft Jet DB work with Entity Framework?

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

问题描述

在此论坛中 here ,有人提到实体框架不适用于Access(Jet DB - .mdb)。然而,似乎有一个Jet DB提供者,如 here 所述。



这使得我认为实体框架中唯一需要的是在定义模型之前定义以下各项:

 <&的ConnectionStrings GT; 
< add name =ProductContext
providerName =Microsoft.Jet.OLEDB.4.0
connectionString =Source = C:\mydatabase.mdb; Jet OLEDB:Database
Password = MyDbPassword;/>
< / connectionStrings>有没有人知道实体框架是否适用于Jet DB,我想确保它在我之前开始,因为我的设计文件取决于这个事实。



谢谢

解决方案

实体框架不支持OLEDB连接,因此您的连接字符串将无法正常工作。实体框架几乎不可能与MS Access协作。您将需要转储您的设计的MS Access部分或实体框架部分。



您可以使用MS Access最接近的是使用强类型数据集和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


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> 

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.

Thanks

解决方案

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.

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

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是否与Entity Framework配合使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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