BC30002: Type OleDb.OleDbCommand' is not defined

  • Thread starter Thread starter Tony Piperato
  • Start date Start date
T

Tony Piperato

Can someone please explain why I am receiving this error (BC30002: Type
'OleDb.OleDbCommand' is not defined)? I am setting up the following for an
Oracle Stored procedure:

Import NameSpace=System.Data.OleDb
dim OraConn As System.Data.OleDb.OleDbConnection
OraConn = New System.Data.OleDb.OleDbConnection
OraConn.ConnectionString =
"Provider=MSDAORA.1;Password=something;UserID=something;Data
Source=mydatasource"
Dim OraCommand As New OleDb.OleDbCommand("My.stored.procedure", OraConn)

Sorry about the cross post but I realized that this is the newsgroup I
should have posted to in the first place.

Regards,

TP
 
I'm not positive, but I'm pretty sure I read that you had to use the oracle
provider library to call a stored procedure...but even if that isn't the
case it doesn't look like you are specifying the commandtype in your query.
Try adding OraCommand.CommandType = CommandType.StoredProcedure and that may
well fix it. I can't find where I read the first part, so I very well may
be wrong about it.

HTh,

Bill
 
Thanks William,

I am including that statement you suggested. I wonder if you are anyone
else could provide an example of calling an Oracle Stored Procedure from
beginning to end. That may help my problem.

Regards,

Tony
 
What happens if you do:

Dim OraCommand As New System.Data.OleDb.OleDbCommand

instead of

Dim OraCommand As New OleDb.OleDbCommand

That's the way that you do the Connection, and that seems to work.

Thanks,

Russ Gray
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top