Click here to Skip to main content
15,879,096 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I am working in MVC4 application with database MSSQL Server2012 using EF5
conncetion string used in the application:
HTML
<add name="INEEntities" connectionString="metadata=res://*/Models.INEModel.csdl|res://*/Models.INEModel.ssdl|res://*/Models.INEModel.msl;provider=System.Data.SqlClient;provider connection string="data source=SADIQUE-PC\MSSQLSERVER2012;initial catalog=INE;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />


Now
I want to use oracle database for the same application(DB is migrated to oracle from MSSQL successfully)

How can I do that ? what changes should be done in connection string.?
Is any changes needed in Model?
Help Plz..
Posted
Updated 25-Sep-13 1:25am
v2

1 solution

Try below one (sample) :

Method 1:

XML
<connectionStrings>
    <add name="VoccDbContext" connectionString="metadata=res://*/Entities.Vocc.VoccModel.csdl|res://*/Entities.Vocc.VoccModel.ssdl|&#xD;&#xA;        res://*/Entities.Vocc.VoccModel.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;DATA SOURCE=sameDbName;PASSWORD=somePass;USER ID=someUser;&quot;"         providerName="System.Data.EntityClient" />
</connectionStrings>



Check this for more :

http://stackoverflow.com/questions/11544191/connection-string-for-oracle-using-entity-framework-and-ldap[^]

Method 2:

XML
<add name="MyEntities" connectionString="metadata=res://*/OracleModel.csdl|res://*/OracleModel.ssdl|res://*/OracleModel.msl;provider=Oracle.DataAccess.Client;provider connection string=&quot;DATA SOURCE= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = MY-SERVERNAME-OR-IP)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = PRODUCTION) ) );PASSWORD=MySecret*1;PERSIST SECURITY INFO=True;USER ID=JAMES.BOND&quot;" providerName="System.Data.EntityClient" />


Check this for more :

http://shanthuk.com/2013/01/13/entity-framework-oracle-connection-string/[^]

I hope this will help to you.
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900