Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to switch my project from using Unmanaged to Managed ODP.NET?

OTNetUserOct 7 2013 — edited Oct 15 2013

Long story short, my server has ODP.NET 2.112.1.2 which does not support Entity Framework currently being used by my ASP.NET application running with ODP.NET 2.112.3.0. The server admin would not upgrade ODP.NET because it is a shared host.

I'm trying to switch to managed ODP.NET. Here is what I did.

+Installed Managed ODP.NET from NuGet. +Verified Oracle.ManagedDataAccess.dll is in the reference +Change the web config from

<connectionStrings> <add name="MYEntities" connectionString="metadata=res://*/App_Code.MYModel.csdl|res://*/App_Code.MYModel.ssdl|res://*/App_Code.MYModel.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;DATA SOURCE=xxxxxx.com;PASSWORD=xxxxx;USER ID=xxxxx&quot;" providerName="System.Data.EntityClient"/>

to:

<connectionStrings> <add name="MYEntities" connectionString="metadata=res://*/App_Code.MYModel.csdl|res://*/App_Code.MYModel.ssdl|res://*/App_Code.MYModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=xxxxxx.com;PASSWORD=xxxxx;USER ID=xxxxx&quot;" providerName="System.Data.EntityClient"/>

+Changed the .edmx file from:

<Schema Namespace="BOTModel.Store" Alias="Self" Provider="Oracle.DataAccess.Client" ProviderManifestToken="11.2" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">

to:

<Schema Namespace="BOTModel.Store" Alias="Self" Provider="Oracle.ManagedDataAccess.Client" ProviderManifestToken="11.2" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl">

When I run the application on my localhost. I get this error:

Unable to find the requested .Net Framework Data Provider.  It may not be installed.  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.  Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.  Stack Trace:   [ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.] System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1426271 System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +27  [ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.] System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +92 System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +246 System.Data.EntityClient.EntityConnection..ctor(String connectionString) +43 System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection) +78 System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config) +32 System.Data.Entity.Internal.LazyInternalConnection.Initialize() +127 System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel() +13 System.Data.Entity.Internal.LazyInternalContext.InitializeContext() +274 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +18 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +52 System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +15 System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +37 System.Linq.Queryable.Join(IQueryable`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector) +96 Competency_Competency.fillPage() in c:\websites\Trustees4.0\BOT\ipad\Competency\Competency.aspx.cs:24 Competency_Competency.Page_Load(Object sender, EventArgs e) in c:\websites\Trustees4.0\BOT\ipad\Competency\Competency.aspx.cs:15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.Web.UI.Control.OnLoad(EventArgs e) +92 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18044
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2013
Added on Oct 7 2013
5 comments
5,248 views