Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

OracleDataAdapter.Fill() fails with Specified cast is not valid exception

99563Jun 2 2004 — edited Feb 15 2006
I'm trying to populate a DataSet using OracleDataAdapter's Fill method and getting the Specified cast is not valid exception.
DataAdapter is created using OracleCommand calling a stored procedure with RefCursor as an output parameter:

cmd = new OracleCommand();
cmd.CommandText ="pack.xquery";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;

OracleParameter inParam = new OracleParameter();
inParam.Direction = ParameterDirection.Input;
inParam.OracleDbType = OracleDbType.Clob;
inParam.Value = DBNull.Value;
inParam.ParameterName = "i_xml";
inParam.Value = clob;
cmd.Parameters.Add(inParam);

cmd.Parameters.Add( "o_rs_0", OracleDbType.RefCursor, DBNull.Value,ParameterDirection.Output);

da = new OracleDataAdapter( cmd );
ds = new DataSet( "RESULT" );
da.Fill( ds );

Any ideias?
Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2006
Added on Jun 2 2004
2 comments
2,489 views