Avoid Oracle schema name with Entity Framework

c# database entity-framework entity-framework-6 oracle

Question

To read the database, I'm using the authorised Oracle SQL and Enterprise Framework driver. But while reading the database, it adds "dbo" before the table name.

SELECT
*
FROM "dbo"."Woningen"

The code runs without the "dbo." prefix fine, but when it does, it throws the "table or view does not exist" problem. This is probable because the user does not have access to that schema since it is not a "dbo" user. I'm using the following Entity Framework code:

[Table("Woningen")]
public class Woningen

When I try to update the Oracle nuget package, the message "Connection string is not well-formed" appears. As a result, it most likely contains the same fault as previously but failed earlier. The connectionString format I used is as follows:

<add name="DefaultConnection"
  providerName="Oracle.ManagedDataAccess.Client" 
  connectionString="USER ID=testUser;PASSWORD=password;  
  Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=serverUrl)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=Database)));"/>

I see three potential fixes for this issue, but I have no clue how to put any of them into practise:

  1. manipulate Entity Framework so that queries don't use schema names
  2. Access the schema for my user.
  3. If anybody understands why the connectionstring format changed, update the driver and correct it.

The current version should be acceptable since the existing code is already functional in production. Since the database and its user are new, their creation may be the source of the issue.

1
3
9/6/2017 7:08:40 AM

Accepted Answer

ZZZ_tmp
3
9/6/2017 8:38:17 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow