The name ‘ParameterDirection’ does not exist in the current context using Oracle.ManagedDataAccess.Client;

I am testing to get the id of an inserted row with dotnet with the package on the title (Oracle.ManagedDataAccess.Client) but when I try to specify the Parameter Direction the class is not recognized and get the error The name ‘ParameterDirection’ does not exist in the current context. I am using .NET 3.1
I am trying to specify it like this:

cmd.Parameters.Add(new OracleParameter(":id", OracleDbType.Int32, ParameterDirection.output));

Does the package not include the class ParameterDirection? Do I need another one?
Thanks.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The ParameterDirection enumerator is available under the System.Data namespace. Please, make sure you are using this namespace.

using System.Data;
using Oracle.ManagedDataAccess.Client;

And try

cmd.Parameters.Add(new OracleParameter(":id", 
                                       OracleDbType.Int32, 
                                       ParameterDirection.Output));


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x