Reputation: 13778
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.
This MSDN page says:
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.
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.
Upvotes: 20
Views: 10526
Reputation: 6491
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).
If you need an EF 6.1 provider for MS Access you can have a look here https://jetentityframeworkprovider.codeplex.com/
Upvotes: 1
Reputation: 329
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.
http://msdn.microsoft.com/en-us/library/bb386977.aspx
Upvotes: 1
Reputation: 8734
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
Upvotes: 0