2014-07-01 50 views
0

我使用EntityFramework 5.0.0和我的数据库是oracle11g客户端12c Oracle数据库(ODP.NET,托管驱动程序)版本12.1.My数据库已存在,所以我打电话给现有的表和我连接我的数据库使用EDMX其连接好,但我没有在我的实际应用程序中使用EDMX,所以我编码1实体和它的配置手动,现在它不能连接我认为我的连接字符串是错误的我的web.config代码是你可以看到下面的连接字符串发行EntityFramework 5.0.0连接与oracle 11g

<configSections> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
</configSections> 

<connectionStrings> 
    <add name="dbContext" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=xxx;PASSWORD=aaa;PERSIST SECURITY INFO=True;USER ID=aaaa&quot;" providerName="System.Data.EntityClient" />   
</connectionStrings> 

请告诉我解决方法。

谢谢

回答

0

下面是我的连接字符串固定连接问题。

<add name="dbContext" connectionString="DATA SOURCE=yourdatasource;PASSWORD=xxx;PERSIST SECURITY INFO=True;USER ID=abc;" providerName="Oracle.ManagedDataAccess.Client" /> 

确保您使用的EF 5.0.0和ODAC 64位(如果你的机器是64位)ODAC 12C第2版(12.1.0.1.2)的Xcopy对于Windows x64

感谢