I'm attempting to connect to an Oracle 11g database from my ASP.NET MVC site. The format for the view and model work for both SQL Server and MySQL, so I shouldn't have problems there, as far as I can tell.
The application even attempts to query the Oracle database, but is throwing an Oracle.ManagedDataAccess.Client.OracleException
in the EntityFramework.dll
and returns an error
ORA-01918: user 'dbo' does not exist
The query that is constructed and sent to the database is:
SELECT "Extent1"."Indext" AS "Indext", "Extent1"."Color" AS "Color"
FROM "dbo"."Tests" "Extent1"
This format seems to indicate its mimicking the SQL Server format.
How do I:
- Change the format of the query?
- If I can't change 1, then how should I be connecting to Oracle in this manner?
I have installed ODP.net. I am referencing System.Data.OracleClient.
Please let me know if I left off vital information.
Relevant database information:
SELECT * FROM ALL_TABLES WHERE OWNER = 'dbo' AND TABLE_NAME = 'Tests';
returns no results. (dbo is a SQL Server thing, near as I can tell.)
SELECT DBMS_METADATA.GET_DDL('TABLE', 'TESTS') FROM DUAL;
returns
CREATE TABLE "USERNAME"."TESTS" ( "INDEXT" NUMBER NOT NULL ENABLE, "COLO
which seems incomplete: "COLO" should be "COLOR"
SELECT * FROM ALL_TABLES WHERE TABLE_NAME = 'TESTS';
Returned nothing interesting, it would be a waste to paste it here, its 90% headers.
Relevant web.config information is as follows:
<add name="OracleConnectionString"
connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xe))) Initial Catalog=Test; Persist Security Info=True; User ID=username; Password=password"
providerName="Oracle.ManagedDataAccess.Client" />
<provider invariantName="Oracle.ManagedDataAccess.Client"
type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342">
</provider>
<add name="ODP.NET, Managed Driver"
invariant="Oracle.ManagedDataAccess.Client"
description="Oracle Data Provider for .NET, Managed Driver"
type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />