Reputation: 53
I use a Oracle Data Provider for .NET (Oracle ODP.NET) in a .NET web application and I connect to database with Entity Framework.
When I create the Entity Data Model, in Web.config, VS2010 create a connection string like this:
<add name="eBoardingEntities" connectionString="metadata=res://*/Models.eBoardingModel.csdl|res://*/Models.eBoardingModel.ssdl|res://*/Models.eBoardingModel.msl;provider=Oracle.DataAccess.Client;provider connection string="DATA SOURCE=emobile;PASSWORD=CHECKIN_USER;PERSIST SECURITY INFO=True;USER ID=CHECKIN_USER"" providerName="System.Data.EntityClient" /></connectionStrings>
But when I deploy the application in production environment, I change the data souce in "DATA SOURCE=emobileProduction"
.
The application in production environment does not work. The error application is : "Table or view not found"
. The application is not connected to DB.
To make it work I need to cancel the Entity Data Model and regenerate this with a new connection to production database.
Any help to not regenerate Entity Data Model, without having to reset connection to database of production?
Upvotes: 3
Views: 621
Reputation: 53
I solved!!!
In oracle, the name of user is the name of the schema.
In production i had the user CHECKIN whereas in develop environment the user was CHECKIN_USER.
For this reason, the schemes have different name and the Entity Model generate in development environment is different from production.
Tanks everybody!!!
Bye.
Upvotes: 2
Reputation: 4954
The error "Table or view not found" can mean two things:
The easiest method to check it is to connect to the database via a tool like PL/SQL Developer og SQL Navigator as the user that you are using and try to select from the table. You can also connect to the database as a user with lots of privileges and query the system views.
The connection string for EF seems OK to me for the production. You set it in the web.config and the most important parts are the data source and the user specifications.
Upvotes: 0