• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3016
  • Last Modified:

Oracle dataaccess client from asp pages without Visual Studio .NET

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

  • 2
1 Solution
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.
tscotttAuthor Commented:
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?
tscotttAuthor Commented:
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


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now