Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help in connecting Oracle database with vb.net

Status
Not open for further replies.

bgmit

Programmer
Apr 19, 2007
5
ET
Imports System.Data
Imports Oracle.DataAccess.Client
I have tried to connect an oracle database using the code below.But an Error message that says :
"An unhandled exception of type 'System.DllNotFoundException' occurred in oracle.dataaccess.dll

Additional information: Unable to load DLL (OraOps10.dll).
"
so,could anybody help me to solve this problem.
Thanks in advance


Public Class Form1
Inherits System.Windows.Forms.Form

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load


Dim oradb As String = "Data Source=mitdb;User Id=scott;Password=tiger;"
Dim conn As New OracleConnection(oradb)
conn.ConnectionString = oradb
conn.Open()

Dim sql As String = "select title from books where isbn > 100" ' VB.NET
Dim cmd As New OracleCommand(sql, conn)


cmd.CommandType = CommandType.Text
Dim dr As OracleDataReader = cmd.ExecuteReader 'OracleDataReader = cmd.ExecuteReader() ' VB.NET
dr.Read()
Label1.Text = dr.Item("title") ' retrieve by column name

End Sub
End Class
 
bgmit,

have you installed the oracle windows drivers? They include Oracle's provider for .NET, and you seem to be missing a driver dll somewhere in the mix.

If you want to find out, start the installer and click on "installed components" which should then provide a list of what's installed.

Regards

Tharg

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top