OldDb Connection

M

mydotnetdoubt

Hai All ,

Pls see the code bellow i'm geeting error on ( Dim dr As New
OleDbDataReader )
what is it

---------------------------------------------------------------------------­--

Imports System.Data.OleDB
---------------------------------------------------------------------------­--

Public Class Form1
Inherits System.Windows.Forms.Form
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim dr As New OleDbDataReader
---------------------------------------------------------------------------­--

Windows form Designer generated Code


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
myConnection = New
OleDbConnection("Provider=MSDAORA.1;UserID=abcd;password=abcd;
database=ora")
Try
myConnection.Open()
myCommand = New OleDbCommand("Select * from invoicemaster",

myConnection)
dr = myCommand.ExecuteReader()
While dr.Read()
MessageBox.Show("Invoice Code " & dr(0))
MessageBox.Show("Invoice No" & dr(1))
MessageBox.Show("Invoice Date" & dr(2))
End While
dr.Close()
myConnection.Close()
Catch ex As Exception
End Try
End Sub
End Class
---------------------------------------------------------------------------­--


%%%%%%%%%%%%%%%%%%%%%%%%%%%

(2) Pls provide some example code which is communicating with oracle
using oledb
(3) What is the relvnt method to connect to oracle (Oledb/Odbc/ODP net)

Pls help
meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee.....................



Thanks
Nau
 
T

tomb

It would help us if you included what the error was.
Besides this, you may want to get the Oracle connectivity driver rather
than using the one provided by microsoft. It will give you better results.

T
 
M

mydotnetdoubt

Dear Tomb.
Tis is the error im gtng...

E:\DotNET\VB.Net\Egs\WindowsApplication2\Form1.vb(6):
'System.Data.OleDb.OleDbDataReader.Private Sub New(connection As
System.Data.OleDb.OleDbConnection, command As
System.Data.OleDb.OleDbCommand, depth As Integer, chapter As
System.IntPtr)' is not accessible in this context because it is
'Private'.

tks nau
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top