Has anyone found a way to make the ADO.NET Entity Framework work with OLE DB or ODBC data sources? Specifically, I need to work with an Access database that for various reasons can't be upsized to SQL.
有人找到办法来制造麻烦了吗?NET实体框架使用OLE DB或ODBC数据源吗?具体地说,我需要使用一个访问数据库,由于各种原因无法将其升级为SQL。
This MSDN page says:
这个MSDN页面说:
The .NET Framework includes ADO.NET providers for direct access to Microsoft SQL Server (including Entity Framework support), and for indirect access to other databases with ODBC and OLE DB drivers (see .NET Framework Data Providers). For direct access to other databases, many third-party providers are available as shown below.
. net框架包含ADO。NET提供程序,用于直接访问Microsoft SQL Server(包括实体框架支持),以及使用ODBC和OLE DB驱动程序间接访问其他数据库(参见.NET Framework数据提供程序)。对于直接访问其他数据库,可以使用许多第三方提供程序,如下所示。
The reference to "indirect access to other databases" is tantalising but I confess that I am hopelessly confused by all the different names for data access technology.
“间接访问其他数据库”的提法令人着迷,但我承认,我对所有不同的数据访问技术名称感到困惑。
3 个解决方案
#1
1
To the best of my knowledge, this is not possible using an entity framework. You can however, use linq to dataset to access your Access (no pun intended) database.
就我所知,这是不可能使用实体框架的。但是,您可以使用linq到dataset来访问您的访问(没有双关)数据库。
http://msdn.microsoft.com/en-us/library/bb386977.aspx
http://msdn.microsoft.com/en-us/library/bb386977.aspx
#2
1
EF cannot use OLE DB directly because an EF provider have to translate c# into specific SQL syntax (OLE DB is a connection to several DBMSs with several SQL syntaxes).
EF不能直接使用OLE DB,因为EF提供者必须将c#转换为特定的SQL语法(OLE DB是与多个DBMSs的连接,具有多个SQL语法)。
If you need an EF 6.1 provider for MS Access you can have a look here https://jetentityframeworkprovider.codeplex.com/
如果您需要一个EF 6.1提供程序进行MS访问,您可以在这里查看https://jetentityframeworkprovider.codeplex.com/
#3
0
I am not so sure about using Access with EF in particular, but it does seem possible to use linq with access. http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/985a1048-cf56-4bb0-b664-61fbf4957890
我不确定是否特别使用EF,但是似乎可以使用linq访问。http://social.msdn.microsoft.com/forums/en/adodotnetentityframework/thread/985a1048 cf56 - 4 - bb0 b664 - 61 fbf4957890
#1
1
To the best of my knowledge, this is not possible using an entity framework. You can however, use linq to dataset to access your Access (no pun intended) database.
就我所知,这是不可能使用实体框架的。但是,您可以使用linq到dataset来访问您的访问(没有双关)数据库。
http://msdn.microsoft.com/en-us/library/bb386977.aspx
http://msdn.microsoft.com/en-us/library/bb386977.aspx
#2
1
EF cannot use OLE DB directly because an EF provider have to translate c# into specific SQL syntax (OLE DB is a connection to several DBMSs with several SQL syntaxes).
EF不能直接使用OLE DB,因为EF提供者必须将c#转换为特定的SQL语法(OLE DB是与多个DBMSs的连接,具有多个SQL语法)。
If you need an EF 6.1 provider for MS Access you can have a look here https://jetentityframeworkprovider.codeplex.com/
如果您需要一个EF 6.1提供程序进行MS访问,您可以在这里查看https://jetentityframeworkprovider.codeplex.com/
#3
0
I am not so sure about using Access with EF in particular, but it does seem possible to use linq with access. http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/985a1048-cf56-4bb0-b664-61fbf4957890
我不确定是否特别使用EF,但是似乎可以使用linq访问。http://social.msdn.microsoft.com/forums/en/adodotnetentityframework/thread/985a1048 cf56 - 4 - bb0 b664 - 61 fbf4957890