specified cast is not valid error while pass an array from vb.net to pl/sql
317197Nov 5 2004 — edited Nov 8 2004Hi,
i'm trying to pass a bind array to a pl/sql procedure from vb .NET, but i get the following error : "Specified cast is not valid"
here it is the pl/sql definition of the procedure :
PROCEDURE ControllaDati(strutt IN rc, id_client IN NUMBER, ret OUT NUMBER);
and the definition for the type rc :
type rc IS TABLE OF VARCHAR2(15) index by binary_integer;
Now the Vb code :
Dim cmd As Oracle.DataAccess.Client.OracleCommand
Dim sCmd As String, lRetVal As Long
sCmd = "BEGIN MODIFICA.controlladati(:ARR, :ID, :RET); END;"
cmd = New Oracle.DataAccess.Client.OracleCommand(sCmd, oraConnection)
cmd.CommandType = CommandType.Text
cmd.Parameters.Add("arr", OracleDbType.Varchar2, ParameterDirection.Input).Value = stru
cmd.Parameters.Add("id", 1).Direction = ParameterDirection.Input
cmd.Parameters.Add("ret", lRetVal).Direction = ParameterDirection.Output
cmd.ArrayBindCount = 10
Try
cmd.ExecuteNonQuery()
Catch ex As Exception
MsgBox(ex.Message)
End Try
i'm sure the connection works, because i use it for other pourpose.
The error appears when the 'cmd.ExecuteNonQuery' is called.
maybe there's something wrong with the array pass from vb .net trought pl/sql procedure ?!?!
thank you.