Oracle dataaccess client from asp pages without Visual Studio .NET

Posted on 2009-04-30
Last Modified: 2013-12-18
I have created a web.config file with an explicit reference to the oracle data access client.

Yet the code will not compile at runtime.

I don't want to buy and install Visual Studio .NET just so I can tell the run-time compiler to include a reference to the oracle.dataaccess.dll

But I can't seem to get the namespace (and associate object) loaded.


      <add name="DllPath"               value="C:\oracle\bin"/>

      <add name="FetchSize"             value="65536"/>

      <add name="PromotableTransaction" value="promotable"/>

      <add name="StatementCacheSize"    value="10"/>

      <add name="TraceFileName"         value="C:\odpnet2.trc"/>

      <add name="TraceLevel"            value="0"/>

      <add name="TraceOption"           value="0"/>





Yet when I try to use an ASPX page that references the oracle.dataaccess.client namespace, I get:

Compiler Error Message: CS0246: The type or namespace name 'Oracle' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 1:  <%@ Page Language="c#" %>

Line 2:  <%@ import Namespace="System.Data" %>

Line 3:  <%@ import Namespace="Oracle.DataAccess.Client" %>

Line 4:  <%@ import Namespace="System.Data.OleDb" %>

Line 5:  <script runat="server">



Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053

for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727

Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

c:\myWeb\CursorTest2.aspx(3,11): error CS0246: The type or namespace name 'Oracle' could not be found (are you missing a using directive or an assembly reference?)

Open in new window

Question by:tscottt
    LVL 9

    Expert Comment

    You need to add a switch to your compiler options. The switch, by itself, should look like this, I believe:


    Or, if that's not the correct DLL, just replace System.Data.OracleClient.dll with the name of the assembly you need to reference.
    LVL 1

    Author Comment

    Thank you tculler, this seems close to the solution I need.  But how to I add a compiler switch without using Visual Studio and telling it to add a reference?  Is there a configuration file somewhere that keeps track of compiler diriectives or references?
    LVL 1

    Accepted Solution

    I found that I need to include the <assembly> reference in my web.config file, populated with the version and key information found in C:\windows\Assemblies

            <add assembly="System.Data.OracleClient, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="Oracle.DataAccess, Version=, Culture=neutral, PublicKeyToken=89B483F429C47342" />


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
    Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
    This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
    This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now