Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Problem with VB .NET (System.Data.OracleClient).


Message #1 by "Ruth Yakubu" <ruyakubu@h...> on Mon, 21 Oct 2002 22:05:27 +0000
Hi All,
 
I'm writing a VB .NET program to connect to a remote Oracle Database.  My program fails to connect to the database when I use the
System.Data.OracleClient connection.  The following is the error I get:
 
An unhandled exception of type 'System.IO.FileNotFoundException'occurred insystem.windows.forms.dll
However, when I try to connect to the database using the System.Data.OleDb connection,  the connection is successful and I'm able to
run transactions against the database.
 
I prefer to use the OracleClient to take advantage of the performance gain.   
 
So, I'm wondering if anyone has been successful in connecting to an Oracle Database using .NET's OracleClient.
 
Thanks in Advance,
*RuthGet faster connections -- switch to MSN Internet Access! Click Here 
Message #2 by "Dror Zeplovitch" <DrorZ@s...> on Tue, 22 Oct 2002 09:12:51 +0200
can you be more specific what is :System.Data.OracleClient connection.
In Dot net there are 2 ways for database connections: A) SqlClient - For 
sql server only!!
B)OLEdb for all other DB Types including Oracle .
Now oledb works with providers . Providers are the guys that let us work 
with SQL NET the talks to the database.
we have 2 providers that can talk to oracle client:
1.Microsoft OLEDB provider for oracle
2 Oracle OLEDB  Provider for  oracle

I guess what U ment is option 2?

=09

-----Original Message-----
From: Ruth Yakubu [mailto:ruyakubu@h...]
Sent: Tue, October 22, 2002 12:05 AM
To: ADO.NET
Subject: [ado_dotnet] Problem with VB .NET (System.Data.OracleClient).


Hi All,
=A0
I'm writing a VB .NET program to connect to a remote=A0Oracle 
Database.=A0 My program fails to connect to the database when I use the 
System.Data.OracleClient connection.=A0=A0The following is the error I 
get:
=A0
An unhandled exception of type 'System.IO.FileNotFoundException'occurred 
insystem.windows.forms.dll
However, when I try to connect to the database using the 
System.Data.OleDb connection,=A0 the connection is successful and 
I'm=A0able to run transactions against the database.
=A0
I=A0prefer to use the OracleClient to take advantage of the performance 
gain.=A0=A0
=A0
So, I'm wondering if anyone has been successful in connecting to an 
Oracle Database using .NET's OracleClient.
=A0
Thanks in Advance,
*RuthGet faster connections=A0-- switch to=A0MSN Internet Access! Click 
Here

---
ASP.NET Distributed Data Applications
This book will inspire you with a range of ideas on how data
can be used to drive Web applications, and how that data can
be most effectively utilized at each level of the design.
Inefficient data use leads to the sort of slow, unresponsive
Web applications that nobody enjoys using. By making good use
of both server and client-side code, we can solve these
problems. This book will arm you with the techniques you need
to build Web applications that fly.
http://www.wrox.com/ACON11.asp?ISBN=3D1861004923
Message #3 by "Ruth Yakubu" <ruyakubu@h...> on Tue, 22 Oct 2002 15:00:27 +0000
Microsoft has a new add-on component to the Microsoft .NET Framework called Microsoft .NET Data Provider for Oracle.  This provides
access to an Oracle database using the Oracle Call Interface (OCI) as provided by Oracle Client.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/manprooracperf.asp
The following is a little sample of my code:
Imports System.Data.OracleClientImports System.Windows.FormsImports System.DataImports SystemImports System.IO
Public Class Form1    Inherits System.Windows.Forms.Form    Dim dbReader As OracleDataReader    Dim connSmall As String =
"Server=svr;database=db;uid=id;password=pwd;"    Dim ftxt As Object    Dim b = CreateObject("Scripting.FileSystemObject")
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim strConnSmall
As New OracleConnection(connSmall)
        If strConnSmall.State = ConnectionState.Closed Then            strConnSmall.Open()        End If
        Dim dbcmd As New OracleCommand()        dbcmd.Connection = strConnSmall        dbcmd.CommandType = CommandType.Text       
dbcmd.CommandText = "Select * from Stuff"
        dbReader = dbcmd.ExecuteReader()
        Dim x As Integer
        ftxt = b.OpenTextFile("c:\oracleDATA.txt", 8, True)
        While dbReader.Read()            For x = 0 To dbReader.FieldCount - 1                ftxt.WriteLine(dbReader(x))           
Next            Console.WriteLine()
        End While
        ftxt.Close()
        dbReader.Close()        strConnSmall.Close()
    End SubEnd Class
The following is the error I get:
An unhandled exception of type 'System.IO.FileNotFoundException'occurred insystem.windows.forms.dlland the execution is getting
stopped at  
Public Class Form1 
Inherits System.Windows.Forms.Form
I would appreciate any input on what I am missing.
Thanks,
*Ruth
 

>From: "Dror Zeplovitch" 
>Reply-To: "ADO.NET" 
>To: "ADO.NET" 
>Subject: [ado_dotnet] RE: Problem with VB .NET (System.Data.OracleClient). 
>Date: Tue, 22 Oct 2002 09:12:51 +0200 
> 
>can you be more specific what is :System.Data.OracleClient connection. 
>In Dot net there are 2 ways for database connections: A) SqlClient - For sql server only!! 
>B)OLEdb for all other DB Types including Oracle . 
>Now oledb works with providers . Providers are the guys that let us work with SQL NET the talks to the database. 
>we have 2 providers that can talk to oracle client: 
>1.Microsoft OLEDB provider for oracle 
>2 Oracle OLEDB Provider for oracle 
> 
>I guess what U ment is option 2? 
> 
> 
> 
>-----Original Message----- 
>From: Ruth Yakubu [mailto:ruyakubu@h...] 
>Sent: Tue, October 22, 2002 12:05 AM 
>To: ADO.NET 
>Subject: [ado_dotnet] Problem with VB .NET (System.Data.OracleClient). 
> 
> 
>Hi All, 
>  
>I'm writing a VB .NET program to connect to a remote Oracle Database.  My program fails to connect to the database when I use
the System.Data.OracleClient connection.  The following is the error I get: 
>  
>An unhandled exception of type 'System.IO.FileNotFoundException'occurred insystem.windows.forms.dll 
>However, when I try to connect to the database using the System.Data.OleDb connection,  the connection is successful and
I'm able to run transactions against the database. 
>  
>I prefer to use the OracleClient to take advantage of the performance gain.   
>  
>So, I'm wondering if anyone has been successful in connecting to an Oracle Database using .NET's OracleClient. 
>  
>Thanks in Advance, 
>*RuthGet faster connections -- switch to MSN Internet Access! Click Here 
> 
>--- 
>ASP.NET Distributed Data Applications 
>This book will inspire you with a range of ideas on how data 
>can be used to drive Web applications, and how that data can 
>be most effectively utilized at each level of the design. 
>Inefficient data use leads to the sort of slow, unresponsive 
>Web applications that nobody enjoys using. By making good use 
>of both server and client-side code, we can solve these 
>problems. This book will arm you with the techniques you need 
>to build Web applications that fly. 
>http://www.wrox.com/ACON11.asp?ISBN=1861004923 
>--- 
> 
>--- 
>ASP.NET Distributed Data Applications 
>This book will inspire you with a range of ideas on how data 
>can be used to drive Web applications, and how that data can 
>be most effectively utilized at each level of the design. 
>Inefficient data use leads to the sort of slow, unresponsive 
>Web applications that nobody enjoys using. By making good use 
>of both server and client-side code, we can solve these 
>problems. This book will arm you with the techniques you need 
>to build Web applications that fly. 
>http://www.wrox.com/ACON11.asp?ISBN=1861004923 
>--- 
Surf the Web without missing calls! Get MSN Broadband. Click Here 

  Return to Index