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

Hi all,

i'm a new here. i found that the titled error occurs when i browse the page. following is a part of the source:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OracleClient" %>
<script language="VB" runat="server">
sub Page_Load(Sender as object, e as eventargs)
dim OracleConn as new OracleConnection("Data Source=testdb;UserId=xxx;Password=xxx;")
OracleConn.Open()
end sub
</script>
i'm now using the oracle db 8.1.7 and the .net framework v1.1.
thanks & regards,
0
bowiecpy
12/2/2004 2:58:10 AM
asp.net.oracle 2269 articles. 0 followers. Follow

4 Replies
1835 Views

Similar Articles

[PageSpeed] 13

Did you add a reference to the System.Data.OracleClient in your project references?
Reading documentation never hurt anyone...
0
Al
12/2/2004 3:23:26 PM
You might need to add the assembly to your web.config file.

<assemblies>
<add assembly="System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f11d50a3a" />
</assemblies>
You can get this info from the GAC located at c:\windows\assembly directory
Hope this helps!

--dweezil

SELECT * FROM users WHERE clue = 'yes';

Records found: 0
0
dweezil
12/2/2004 7:34:57 PM
thanks for your reply.

since i just use a notepad to build my .aspx, i haven't built any project. however, i found that when i added the CompilerOptions on my Page directives, the mentioned error would not occured. by the way, another error "BC30560: 'OracleConnection' is ambiguous in the namespace 'System.Data.OracleClient'" occured. when i declare the connection variable, i also using the fully quilifed name.
<%@ Page Language="vb" CompilerOptions='/R:"C:\Windows\Microsoft.NET\Framework\v1.1.4322\System.Data.OracleClient.dll"' %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OracleClient" %>
<script language="VB" runat="server">
sub Page_Load(Sender as object, e as eventargs)
dim OracleConn as new System.Data.OracleClient.OracleConnection("Data Source=testdb;User Id=xxx;Password=xxx;")
.....
end sub
</script>
what's wrong on my code ??
thanks & regards,
0
bowiecpy
12/4/2004 4:34:32 AM
may i suggest a few changes.  

1) copy the file System.Data.OracleClient.dll into your app's bin directory.
2) add to your web.config file the following lines, inside the configurtion tag

<appSettings>
<add key="DSN" value="Data Source=testdb;User Id=xxx;Password=xxx;" />
</appSettings>

3) your page

<%@ Page Language="vb"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OracleClient" %>
<script language="VB" runat="server">
sub Page_Load(Sender as object, e as eventargs)
dim OracleConn as new System.Data.OracleClient.OracleConnection(System.Configuration.ConfigurationSettings.AppSettings("DSN"))
.....
end sub
</script>

this may be stylistic, but it has a few advantages.
1) you can change your un/pw and not have to update every .aspx file with the new info.
2) you can post your code directly to the forums without having to first edit out the password info.
3) if for some strange reason someone were to get access to the source of the aspx file but not have access to the web.config they still wouldnt be able to screw up your data.
0
jeffreyabecker
12/6/2004 2:50:17 PM
Reply:

Similar Artilces:

The type or namespace name 'OracleClient' does not exist in the class or namespace 'System.Data'
I am using notepad to code my ASP.NET pages. Line 3: using System.Data.OleDb; Line 4: using System.Web; Line 5: using System.Data.OracleClient; Line 6: Line 7: public class OConn .. .. .. Source File: c:\inetpub\wwwroot\Oracle8.cs Line: 5 I know if I precompile the *.dll in my *.aspx page, it will work (<%@ Page language="c#" CompilerOptions=/R:"C:\WINNT\Microsoft.NET\Framework\v2.0.40607\System.Data.OracleClient.dll" Debug="true"%>). But i do not know the equivalent solution to implement in a *.cs file. Please ...

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

Got compilation error: BC30561: 'DataSet' is ambiguous, imported from the namespaces or types 'System.Data, DreamweaverCtrls'.
Can anyone can tell me how to fix this??? Please Check the following link for your answer.. http://forums.asp.net/t/991198.aspx-SuganRemember to click “Mark as Answer” on the post If you get answer from this post(s) ! ...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

Error "CS0234: The type or namespace name 'Data' does not exist in the namespace 'System'"
Dear all,the following web site ran for months without troubles http://www.fotovoltaico.sanzeno.org/StoricoRS.aspxSuddenly yesterday I started getting the error you can see switching to that site. I am really getting crazy wondering what happened, but I have no idea. Do you have any suggestion? Thank you in advancePierluigi ...

Cast from type ''''DBNull'''' to type ''''String'''' is not valid.
How do I avoid getting this error: Cast from type ''''DBNull'''' to type ''''String'''' is not valid. I am trying to get values from the database into a form for updating using a Datareader, SQL is set to allow nulls for certain fields as they are not required but the only way I can get the form to display is by adding a space in SQL. Is there another way around this? Check if it is equal to DBNull.Value first and if it is, don't do the cast.Stanley Tan theSpoke Blog Where in the code does it need to go? I am using the following and it's the profile that isn't always requi...

Error: foreach statement cannot operate on variables of type 'System.Data.DataSet' because 'System.Data.DataSet' does not contain a definition for 'GetEnumerator', or it is inaccessible
I am getting error on this line DataSet dsdata=new DataSet(); SQL="Seelct * from tablename"; //dsdata contains result of the above query foreach(DataRow dr in dsdata) //This line gives error Error: foreach statement cannot operate on variables of type 'System.Data.DataSet' because 'System.Data.DataSet' does not contain a definition for 'GetEnumerator', or it is inaccessible DataSet dsdata=new DataSet(); SQL="Select * from tablename"; //dsdata contains result of the above query foreach(DataRow dr in dsdata.Tables[0].Rows) //This ...

Error type 'System.Data.DataTable' to type 'PRODUCT_LISTDataTable'
I can't figure this one out. I created new solution in vs2005 from using vs2003 and I have a problem I can't find an answer to. I get the following error that relates to passing a system.data.datatable to a dataset.datatable named "ProductList.PRODUCT_LISTDataTable".  It says it can't cast the object from one type to the other, and I've tried "CType" and doesn't work. Error: Unable to cast object of type 'System.Data.DataTable' to type 'PRODUCT_LISTDataTable'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trac...

The type or namespace name 'SqlServer' does not exist in the namespace 'System.Data'
Hi, I have created a .net class library and i include the namespace : using System.Data.SqlServer but when i build my .net class library i get the folowing error: The type or namespace name 'SqlServer' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)    your help is highly appreciated Best regards System.Data.SqlClient not System.Data.SqlServerArticles and news on ASP/ASP.NETASPCode.net Thank you for the support I am Creating a Trigger using Managed Code in SQL Server so i create a class contains the following: using Syst...

Namespace or type 'com_amazon_webservices' for the Imports 'com_amazon_webservices' cannot be found.
An example of what I am trying to do is here: http://www.sitepoint.com/article/amazon-web-services-asp-netI am trying to do it w/o VS though So, first I create the proxy...by typing.. C:\Program Files\Microsoft.NET\SDK>wsdl.exe /l:VB http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl That gives my my AWSECommerceService.vb file for the web service. I then compile that file to get AWSECommerceService.dll, and I place this file in the bin directory of my applicatoin. BUT...the problem I get now...is the following... Server Error in '/' Applicati...

BC30466: Namespace or type 'UI' for the Imports 'Microsoft.Matrix.Framework.Web.UI' cannot be found.
Hi, Ok - story so far. I created a web in a single page in WebMatrix. Then I wanted to compile it, so I spilt it into a codebehind and an aspx and at the same time installed VS.Net 2002 and started working in that. The app uses an MXDataGrid (well 4 actually), but when run in the browser comes up with : >BC30466: Namespace or type 'UI' for the Imports 'Microsoft.Matrix.Framework.Web.UI' cannot be found. I have added a reference to "Microsoft.Matrix.Framework.DLL", and added imports but it still doesnt work SO, I have created a tiny test app, that does nothing expec...

Error: Value of type 'System.Data.CommandBehavior' cannot be converted to 'System.IAsyncResult'.
  I wrote this code to retrieve data from the database using autocomplete extender control. Dim Dr As SqlDataReaderDim RtData As List(Of String) = New List(Of String) Dr = MysqlCmd.EndExecuteReader(Data.CommandBehavior.CloseConnection) While Dr.Read()RtData.Add(Dr("CustName").ToString()) End While   Plz Help!   regards   yamani     The EndExecuteReader does not take a CommandBehavior.  The BeginExecuteReader does.  Please follow the example on the MSDN documentation:http://msdn.microsoft.com/en-us/library/kddf8ah6....

SqlDataSource.Select Error: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.
I am trying to use the select statement to put a field from my database using a SqlDataSource named 'FileBase.' I am using the following code: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'" myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)But when I run the code I get the following error:Server Error in '/YorZap' Application. Unable to cast object of type 'System.Data.DataView' to type 'System.String'. Description:...

SqlDataSource.Select Error: Unable to cast object of type 'System.Data.DataView' to type 'System.String'.
I am trying to put the data from a field in my database into a row in a table using the SQLDataSource.Select statement. I am using the following code: FileBase.SelectCommand = "SELECT Username FROM Files WHERE Filename = '" & myFileInfo.FullName & "'" myDataRow("Username") = CType(FileBase.Select(New DataSourceSelectArguments()), String)But when I run the code, I get the following error:Server Error in '/YorZap' Application. Unable to cast object of type 'System.Data.DataView' to type 'System.String'. Descri...

Web resources about - error BC30466: Namespace or type 'OracleClient' for the Imports 'System.Data.OracleClient' cannot be found - asp.net.oracle

Resources last updated: 12/7/2015 4:47:56 AM