Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 14th, 2004, 12:08 PM
mel mel is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.net page can't find namespace system.data.orac

Hi
I have an Oracle database to connect to. If I write the code in a class and compile it with vbc and then reference my namespace in the asp.net page it connects up to the database. If I just write call the code in an asp.net page and import the system.data.OracleClient, the page throws up an error saying it can't find the namespace
Can anyone help

Mel

 
Old April 14th, 2004, 12:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Did you install the OracleClient?

 
Old April 15th, 2004, 02:22 AM
mel mel is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If the code is all contained as an assembley (ie a dll, compiled using the vbc command line tool) everything is ok. The Oracle client software is on the web server machine. It seems to have a problem referencing the Namespace if the code is all in an asp.net web page

 
Old April 16th, 2004, 11:06 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Can you post just the relevant bits of code for this problem? Like the class declaration for the page and the import statements? We don't need all the guts of your page or the data access code, just the parts that relate directly to this problem.

I'm a little confused by your first post:
A) Is your custom class code consuming system.data.OracleClient classes and failing?
B) Is the ASP.net page trying to consume system.data.OracleClient classes and failing?
C) Is the ASP.net page trying to consume your custom class and failing?

Peter
-------------------------
Work smarter, not harder
 
Old April 19th, 2004, 03:18 AM
mel mel is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi
Just by including <%@ Import Namespace="System.Data.OracleClient" %> in an aspx web page causes the following error BC30466: Namespace or type 'OracleClient' for the Imports 'System.Data.OracleClient' cannot be found.

Line 19: Imports System.Data.OracleClient



 
Old December 2nd, 2004, 05:17 PM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having the same problem. I have installed the ODBC drivers and have installed ODP.net. There is a reference made in my project to Oracle.DataAccess.dll yet I still get the same message.

error BC30466: Namespace or type 'OracleClient' for the Imports 'System.Data.OracleClient' cannot be found.


Here is my code that just trys to make a simple connection to the database:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="OleDbConnection.aspx.vb" Inherits="tryagain.OleDbConnection"%>
<%@ Import NameSpace="System.Data.OracleClient"%>



<Script runat="server">
Sub Page_Load( s As Object, e As EventArgs )
    Dim conOracle As OracleConnection

    conOracle = New OracleConnection("Data Source=trng;User Id=burrjh;Password=melissa84;")
    conOracle.Open()
    conOracle.Close()
End Sub




</Script>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <title>OracleDbConnection</title>
        <Script runat="server">



        </Script>
        <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
        <meta name="vs_defaultClientScript" content="JavaScript">
        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    </HEAD>
    <body MS_POSITIONING="GridLayout">
        Connection Opened!
        <form id="Form1" method="post" runat="server">
        </form>
    </body>
</HTML>

Thanks,

Jason

 
Old December 2nd, 2004, 05:24 PM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Just found the answer that worked for me.

I had the same error msg after installing this driver.
I added ref to project and registered System.Data.OracleClient.dll with gacutil but error continued.
When I copied the dll to the project bin directory, it was able to use the driver. It also continues to use it now that I have deleted the dll from the project bin.
A bit of a mystery to me but it seems to work.


hope this helps






Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling Looped XML Data Into ASP.NET Page kwilliams ASP.NET 2.0 Professional 2 January 22nd, 2008 11:34 AM
syntax error?<%@ Import Namespace="System.Data" %> fjm9 ASP.NET 1.0 and 1.1 Basics 2 January 16th, 2007 11:51 AM
Syntax error? <%@ Import Namespace="System.Data" % fjm9 C# 1 January 16th, 2007 09:17 AM
using data filtered from asp.net page to generate ashutoshpandey31 Crystal Reports 0 March 12th, 2005 09:40 AM
How do I find the .dll name for a namespace? cjo ASP.NET 1.0 and 1.1 Basics 2 November 28th, 2003 03:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.