MSDN Archive Home
Help and FAQs
Sample Entity Framework Provider for Oracle
All Resource Updates
Change History (all pages)
This is a Sample Entity Framework Provider for Oracle. It works with Oracle 10g by wrapping System.Data.OracleClient APIs. It uses the same technique as Entity Framework Sample Provider which wraps System.Data.SqlClient.
Sample Entity Framework Provider for Oracle is compatible with Entity Framework released as part of .NET Framework 3.5 SP1.
This is an unsupported sample and should be treated as such. Although reasonable effort has been put to make sure that basic EF scenarios work with Oracle, there are certain limitations. Use in production environment is strongly discouraged.
Install Visual Studio 2008 SP1.
Install Oracle 10g Express Edition from
Add new user "edmuser" with password "123456" (if you change the user name/password you will need to update connection strings). The user needs to have permissions to create database objects (assigning the user to DBA role is the quickest way to give necessary permissions).
The default connection string is using XE name from tnsnames.ora. If you have installed a different version of Oracle or used different instance configuration, you will have to update connection strings in App.config files.
Review "OracleNorthwind/install_db.cmd" and adjust path to sqlplus.exe as necessary then run the batch file. It will create and populate a Northwind sample database in "edmuser" schema.
Open the solution file EFOracleProvider.sln and run "EFOracleProvider.AdHocTests" and "Entity Framework Query Samples"
BINARY_FLOAT/BINARY_DOUBLE types are not supported. This is a limitation of underlying System.Data.OracleClient. Columns using those types have been replaced with NUMBER.
Oracle DDEX Provider for Visual Studio is not included. Example DDEX provider that supports SQL Server is available as part of EF Sample Provider at
APPLY operator is not supported by Oracle. As a result, certain queries that internally use this operator (such as "Average - Grouping 1", "Max - Grouping", "Min - Grouping") are not supported.
Certain functions (AVG in particular) return numeric values that cannot be properly materialized as decimal by System.Data.OracleClient. As a result users will get OCI-22053 (overflow).
Aug 13 2008 at 4:55 AM
, version 9
Jul 4 2008 at 1:16 PM
I work on a project which works on two databases : SQL Server and Oracle.
Could I create two EDMX files, one for SQL Server (using Microsoft provider), the other for Oracle (using this provider) ?
The choice of the database could be a parameter on my web.config file...?
Aug 13 2008 at 2:35 PM
Hello, I've migrated an edmx to use this Oracle provider (and also migrated the MSSQL database to Oracle 10g). Now I'm getting the following:
Schema specified is not valid. Errors:
EFOracleProvider.Resources.EFOracleStoreSchemaMapping.msl(3,4) : error 2002: The EntityContainer 'SchemaInformation' for the conceptual model specified as part of this MSL does not exist in MetadataWorkspace.
I don't know what that means, please help !
Jan 23 2009 at 5:14 AM
How this thing work with stored procedures?
Jan 29 2009 at 11:16 AM
I would like to know if this example works with LINQ to Oracle...
Nov 3 2009 at 8:42 PM
Will it work with Oracle 11g and/or VS 2010.. anybody try it?
Dec 1 2009 at 11:55 AM
gonna try it tomorrow.
Feb 8 2010 at 9:43 PM
Can anyone tell me how to install the EF Data Provider?
Jun 15 2010 at 7:24 PM
I successfully got this working under VS 2010 with Oracle 11g. You have to open the solution from within VS and let it convert it. Then, you must modify the Post-Build event on the EFOracleProvider project as it references the gacutil.exe in the ...6.0A\Bin directory. I had to change mine to the 7.0A\bin directory.
Jul 5 2010 at 8:59 AM
Generated sql is:
Dec 15 2010 at 11:14 AM
i tried to install and execute, and it seems to work. In the output window I read some generated SQL queryes (eg: SELECT
"Extent1"."CategoryID" AS "CategoryID",
"Extent1"."CategoryName" AS "CategoryName",
"Extent1"."Description" AS "Description",
"Extent1"."Picture" AS "Picture"
FROM "Categories" "Extent1"
WHERE ("Extent1"."CategoryID" = :p__linq__2) AND (ROWNUM <= (1) ))
but what I expect to find is some interactive environment where I could set parameters and see query results displayed. Nothing of that happened. Please can anybody explain how does it work?
Another question: how can I fit this sample to my Database? I tried to create WPF application with Visual Basic; then I tried to create a Entity Data Model, but I could not get to connect the .edmx file to my Oracle DB, because I just can see SQL Server Drivers!
Feb 4 2011 at 10:06 AM
This provider is not able to generate anything related to "SEQUENCES" of Oracle. Can somebody help us in using Sequence to create running sequence number as primary key in a table?
May 3 2011 at 3:42 PM
Beppe71, You could use RV's Entity Visualizer to view the native SQL, choose appropriate available providers via a combo box and execute the SQL query. Also can change the parameters every time and change provider at will. This free tool/visualizer for VS2010 and VS2008 are available at www.rajavenkatesh.com/projects.aspx.
Sign in to add a comment
Mon Aug 11 2008 at 7:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.