I am developing a web application using ASP.NET MVC with Entity Framework. After I finished, the IT told me that they cannot use SQL Server localdb on their server, so I need to transfer to an Oracle database. The problem is, I have no idea how to accomplish this.
What I managed to far: I found out I need to use Oracle Entity Framework and somehow managed to add Oracle.ManagedDataAccess.EntityFramework (the internet is pretty restricted here and I could not use NuGet). I also modified the connection string and provider. The problem is, an exception occurs:
An exception of type 'System.Data.Entity.Core.ProviderIncompatibleException' occurred in EntityFramework.dll but was not handled in user code
Additional information: An error occurred accessing the database. This usually means that the connection to the database failed. Check that the connection string is correct and that the appropriate DbContext constructor is being used to specify it or find it in the application's config file.
Web.config:
<add name="DBCS"
connectionString="DATA SOURCE=source;PASSWORD=pass;PERSIST SECURITY INFO=True;USER ID=user"
providerName="Oracle.ManagedDataAccess.Client" />
...
<entityFramework>
<defaultConnectionFactory
type="Oracle.ManagedDataAccess.EntityFramework.OracleConnectionFactory, Oracle.ManagedDataAccess.EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="Oracle.ManagedDataAccess.Client"
type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers>
</entityFramework>
Context and how I use it:
public class InventoryContext : DbContext
{
public InventoryContext() : base("DBCS")
{ }
...
}
InventoryContext db = new InventoryContext();
db.Items.ToList() //use the rows
How can I make it work?
nuggettoremoveandaddnecessarycomponents. other wise very difficult to configure it.nugget.we can support it if you'll have any issues after thenuggetupdate.these days no one is doing it manually. I have sorted out an issue which it came after the nugget update.you can see that here :stackoverflow.com/questions/39605532/…