Connecting to oracle database

shankar_it

Well-known member
Joined
Jul 6, 2005
Messages
46
i am new to .net and i am using 2003.Can any one help me with a simple C# or Vb.net program to connect to a oracale 8.0.5 database and pass some values to a stored procedure.

thanks,
shankar
 
This is a not so simple task. There are some things that you need first.
1. An oracle listener file.(for Oracle 8) this is most of the time provided/included in an Oracle procedure editing software like toad. So if you have Toad installed, then you can connect. For newer Oracle verions (Oracle 10g) you can use ODP.Net which is the dataprovider for Oracle.
2. Of course you will need to have Include System.Data.OracleClient namespace.

For the stored procedures:
it is almost the same as SQLServer but most cases you will need ot explicitly declare an output parameter.

Something of the likes of:
Dim myOutparam as New OracleParameter
With myOutParam
.ParameterName = @outData
.ParameterDirection = Output
End With

For the Oracle Stored Procedure itself, it needs to declare an output parameter as Type Cursor.

I hope this helps.
 
one more thing..

be careful handling the Boolean type field of Oracle. It does not return True or False. It returns Y or Null
 
Back
Top