OracleDbType for varchar and Cursor

I've inherited old 2.x framework code.

I am adding a parameter for an oracle database:
ObjCommand.CommandType = CommandType.StoredProcedure
            ObjCommand.Parameters.Add("e_this", OracleType.VarChar, 10).Value = strThis

It errors saying "OracleType" is not declared.
It suggests I import

But this won't work:
Because the function is looking for an Oracle.DataAccess.Client.OracleDbType

If I try this:
It says varchar is not a member of OracleDbType.

What do I do?

If I change it to: OracleDbType.Varchar2 will that hurt anything?

I also have:

Which is errors. How do I pass in a cursor type?

I tried this:
            ObjCommand.Parameters.Add("result_cursor", System.Data.OracleClient.OracleType.Cursor).Direction = ParameterDirection.Output

This does work, but there is no 3rd parameter, and the type the function is looking for is an object.

Should I do it that way for the cursor?

Starr DuskkASP.NET VB.NET DeveloperAsked:
Who is Participating?
DhaestConnect With a Mentor Commented:
using ODP.Net you must use OracleDbType
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:
But you did'n answer the question. What is the comparable type for "varchar" and "cursor"?
Starr DuskkASP.NET VB.NET DeveloperAuthor Commented:

OracleDbType.Varchar2 and refcursor?
Inference of System.Data.DbType from OracleDbType
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.