The Oracle client is not installed on a server that uses ASP.

Source: Internet
Author: User
Tags connectionstrings ntfs permissions

Corporate servers have always been using the. Net+sqlserver development approach, and there is a project that needs to read the requirements of remote Oracle. Because Oracle basically does not, is also one side to do the groping.

The first is to use the tool test is connected, because the previous use of MySQL is used navicat, so directly on the Internet download navicat for Oracle, but the dead and alive are not even, the newspaper tried all methods online, download inistallclient, modify OCI, Add environment variables, new Tnsnames.ora are useless, has been cannot load OCI dll,126 error , also tried to navicat and Oracle client and server version of all unified, so error, Finally download the Oracle official Sqldeveloper, a success, say or Java's awesome ah. Sqldeveloper

Next, use ADO to start the Oracle connection, publish to the server, the result error System.Data.OracleClient requires Oracle client software version 8.1.7 or later. Tried the online program:

1. Install inistallclient new environment variable, no

2.web.config connection directly written <add name= "clientoracle" providername= "System.Data.OracleClient" connectionstring= "password= XXXX; User id=xxxx;data source= (description= (address_list= (address=) (PROTOCOL=TCP) (host=xxxx)) (port=1521 = (server=dedicated) (SERVICE_NAME=ORCL)); "/> Still not.

3. Put 4 DLLs such as Oci.dll in the System32 folder or not

4. Installation of Oracle 11g full version, still no

5. How to connect using ODBC or not ... (64-bit, 32-bit test)

Finally, using visual Studio nuget to download the installation of the Oracle.manageddataaccess package succeeds, and the package only requires a configuration of a DLL and Web. config, and does not require an Oracle client.

In the generated Web. config

<configSections> <section name="oracle.manageddataaccess.client"Type="OracleInternal.Common.ODPMSectionHandler, Oracle.manageddataaccess, version=4.122.1.0, Culture=neutral, publickeytoken=89b483f429c47342"/> </configsections><connectionstrings><add name="oracledataaccess"connectionstring= "DATA source=sampledatasource; PERSIST SECURITY info=true; USER id=xxxx;             password=xxxx; " Providername= "Oracle.ManagedDataAccess.Client"/></connectionStrings><system.data> <DbProviderFactories> <remove invariant="Oracle.ManagedDataAccess.Client"/> <add name="odp.net, Managed Driver"Invariant="Oracle.ManagedDataAccess.Client"description="Oracle Data Provider for. NET, Managed Driver"Type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.manageddataaccess, version=4.122.1.0, culture= Neutral, publickeytoken=89b483f429c47342"/> </DbProviderFactories> </system.data> <oracle.manageddataaccess.client> <version number ="*"> <dataSources><datasource alias= "sampledatasource" descriptor= "(description= (address= (protocol=tcp) (HOST=XXXX) (port=1521)) (Connect_data= (SERVICE_NAME=ORCL))) "/></dataSources> </version> </oracle.manageddataaccess.client>

You only need to modify the red parts, you can use the way to connect with ADO, the link is created using new Oracle.ManagedDataAccess.Client.OracleConnection (strconn).

In addition, Oracle.dataaccess (Odp.net), which was used in the past, unmanaged, needed to oci.dll the library, and therefore needed to install the Oracle Client, and the 32-bit and 64-bit versions were differentiated, Oracle.DataAccess.dll needs to access the Oracle client files when executing, but also to exclude NTFS permissions problems, PATH environment variables and other problems, more cumbersome.

and managed odp.net does not need to install Oracle Client only need one Oracle.ManagedDataAccess.dll can, and is any CPU no longer 32 bit/64 bit distressed

While this technology is already available, it's a Help for Oracle novices.

The Oracle client is not installed on a server that uses ASP.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.