I made application using DataBase First approach with oracle (in this way https://www.youtube.com/watch?v=tk_EDjTzZCE)
Everything works fine. But if I change userId and password in connectionString (because I want to use another database), then application doesn't work. I have an error: ORA-00942: table or view does not exist
so application can connect to database, but can't see tables?
For example:
<add name="DbEntities" connectionString="metadata=res://*/DAL.DbModel.csdl|res://*/DAL.DbModel.ssdl|res://*/DAL.DbModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string="DATA SOURCE=someapp_first.amazonaws.com:1521/ORCLBK;PASSWORD=apple123;USER ID=FRUIT"" providerName="System.Data.EntityClient" />
<add name="DbEntities" connectionString="metadata=res://*/DAL.DbModel.csdl|res://*/DAL.DbModel.ssdl|res://*/DAL.DbModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string="DATA SOURCE=someapp_second.amazonaws.com:1521/ORCL2;PASSWORD=apple123;USER ID=FRUIT"" providerName="System.Data.EntityClient" />
<add name="DbEntities" connectionString="metadata=res://*/DAL.DbModel.csdl|res://*/DAL.DbModel.ssdl|res://*/DAL.DbModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string="DATA SOURCE=someapp_third.amazonaws.com:1521/ORCL3;PASSWORD=wege123;USER ID=POTATO"" providerName="System.Data.EntityClient" />
Each database is created on the same server (same strucuture of course). Application will works fine on 1st and 2nd connectionString, but with 3rd won't works. Because there is another UserId/Password.
What's happening?
@EDIT
New Clue. If I put breakpoint on var = data.DB_USER.ToList();
{SELECT
"Extent1"."ID" AS "ID",
"Extent1"."FIRST_NAME" AS "FIRST_NAME",
"Extent1"."LAST_NAME" AS "LAST_NAME",
"Extent1"."DESCRIPTION" AS "DESCRIPTION",
"Extent1"."NOTES" AS "NOTES",
"Extent1"."DEFAULT_CUSTOMER_MODULO" AS "DEFAULT_CUSTOMER_MODULO",
"Extent1"."VERIFICATION" AS "VERIFICATION",
"Extent1"."STATUS" AS "STATUS",
"Extent1"."PIN" AS "PIN"
FROM "FRUIT"."DB_USER" "Extent1"}
Check last line. There is FRUIT
instead POTATO
. So query is wrong. Why VS using old SCHEMA if I changed connctionstring. I'm using 3rd instead 1st connectionString.