Accessing Oracle package function from .net?

A

AA

Hello, I need to access to a function that is inside a Oracle Package

But When the ORACommand.ExecuteReader is called, this error return:

System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7:
PLS-00221: 'TestFunction' is not a procedure or is undefined
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored


My Simple code test is...


Dim ORAConn As New OracleClient.OracleConnection(MyConnString)
ORAConn.Open()
Dim ORACommand As New
OracleClient.OracleCommand("dbadmin.testpackage.TestFunction")
ORACommand.Connection = ORAConn
ORACommand.CommandType = CommandType.StoredProcedure
ORACommand.Parameters.Add("Here I add a input parameter")
ORACommand.Parameters.Add("Here I add a output parameter")

Dim RS As OracleClient.OracleDataReader = ORACommand.ExecuteReader() <--
Here the error occur
Dim Result As String = ORACommand.Parameters("funcOut").Value



Please help me

Thanks
 
A

AA

I found my error.

I need to set a returnValue parameter (where the function result will be
stored) and execute as "ExecuteNonQuery"
 

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