2017-09-26 11 views
0

MVCプロジェクトでOracleデータベースに初めて接続するプロジェクトを作成しています。私は手紙に指示に従ったソースherehereを見つけましたが、まだそれを働かせることはできません。Entity FrameworkをOracle 11gに接続しない

私が続いている手順は、次のとおりです。Oracleのライブラリ
4を参照さ

1)インストールされたOracle開発ツールVisual Studio用
2)インストールEn​​tity Frameworkのバージョン6
3))は、WebへのOracleプロバイダーを追加しました私のプロジェクトのconfigとappの設定 5)データベーススキーマから新しいエンティティデータモデルを追加しようとしましたが、データ接続の設定時にOracleのデータプロバイダが表示されることはありません。それがすべてで解決策をもたらすならば、あなたが見ることができるよう

<configSections> 
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> 
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> 
    <section name="oracle.manageddataaccess.client" 
     type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342"/> 
</configSections> 
<connectionStrings> 
    <add name="MinimumInventory" connectionString="Server=SQLServerName\ServerInstance;Initial Catalog=DatabaseName;Integrated Security=True" 
     providerName="System.Data.SqlClient"/> 
    <add name="ThirdWaveData" connectionString="Server=OracleServerName;Initial Catalog=databaseName; User Id=myID; Password=myPassword; Integrated Security=True" 
     providerName="Oracle.ManagedDataAccess.Client"/> 
</connectionStrings> 
<providers> 
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> 
    <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" /> 
</providers> 

、私はまた、SQLサーバに接続しています:

は、ここに私のWebConfigです。

答えて

0

oracle 12ドライバ/クライアントをダウンロードすることが重要です。それ以外の場合は、本番サーバーにoracleをインストールする必要があります。

データベースプロジェクトでOracle.DataAccessを参照しています。 enter image description here

代わりののConfigurationManager次を使用することができますweb.configファイルでhttps://github.com/codingfreak/cfUtils/blob/d0769751ac64e8a67aea028821bef2a270dc525c/Logic/Logic.Utils/Utilities/ConfigurationUtil.cs

私の接続文字列は次のようになります。

<connectionStrings> 
    <add name="oracle" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.123)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PD)));User ID=MyUSER;Password=MyPassword;" /> 
    </connectionStrings> 
関連する問題