Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change connection string .NET Oracle error

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=&quot;DATA SOURCE=emobile;PASSWORD=CHECKIN_USER;PERSIST SECURITY INFO=True;USER ID=CHECKIN_USER&quot;" 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?

like image 347
user1239944 Avatar asked Dec 08 '25 06:12

user1239944


1 Answers

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.

like image 120
user1239944 Avatar answered Dec 11 '25 11:12

user1239944



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!