The problem of dependency on Oracle databases for more than a month has not been solved. Recently, the task was not busy, so I decided to solve the problem. Write an article for record.
The above error mainly occurs when the net program Oracle database uses Microsoft Enterprise Library 5.0
The class library can access the Oracle database, which is capable of excellent access to the database. The same error occurs if the method is incorrect. The solution is to download the http://www.microsoft.com/en-us/download/confirmation.aspx? Id = 15104 latest class library and install it. After installation, go to the installation directory to obtain the required assembly and go to the bin directory of the program. (If the class library is used, go to the bin directory of the class library, after a solution is generated, the referenced DLL is automatically stored in the bin directory of the web.
Using Microsoft. Practices. enterpriselibrary. Data;
Microsoft. Practices. enterpriselibrary. Common;
Microsoft. Practices. enterpriselibrary. logging;
...
After the class library is referenced, You need to configure it in the configuration file. Copy the following configuration to the configuration file. Note that the Assembly version and database connection string are the main ones. If the configuration is correct, it is okay:
<Configuration>
<Configsections>
<Section name = "loggingconfiguration" type = "Microsoft. practices. enterpriselibrary. logging. configuration. loggingsettings, Microsoft. practices. enterpriselibrary. logging, version = 5.0.414.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" true "/>
<Section name = "dataconfiguration" type = "Microsoft. practices. enterpriselibrary. data. configuration. databasesettings, Microsoft. practices. enterpriselibrary. data, version = 5.0.414.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" true "/>
<Section name = "cachingconfiguration" type = "Microsoft. practices. enterpriselibrary. caching. configuration. cachemanagersettings, Microsoft. practices. enterpriselibrary. caching, version = 5.0.414.0, culture = neutral, publickeytoken = 31bf3856ad364e35 "requirepermission =" true "/>
</Configsections>
<Dataconfiguration defaultdatabase = "ccnf_ora"/>
<Connectionstrings>
<Add name = "ccnf_ora" connectionstring = "Data Source = database; Password = dbpassword; user id = username; Max pool size = 10000" providername = "system. data. oracleclient "/>
</Connectionstrings>
</Configuration>
Note that the version in the configuration file is 5.0.414.0. The version must be the same as the version referenced by the program. Otherwise, the above error is also reported.