14

I have a project which is using System.Data.OracleClient at the moment and since it is being deprecated so I want to switch to the ODP.NET latest version for Oracle 11g. Please let me know if the following steps would work for me or there are certain other actions required to get it working without any errors:

  • Remove the reference to the SYstem.Data.OracleClient
  • Adding the reference to Oracle.DataAccess dll
  • Replacing OracleType enum with OracleDbType and updating the references to datatypes from VarChar to Varchar2 etc.
1
  • And, of course, change your using directives. But otherwise, I think they are specifically designed to be compatible, so you can take it as a drop-in replacement. Commented Sep 21, 2011 at 11:50

1 Answer 1

18

You've pretty much got it.

Here's the Oracle writeup I followed when doing this: http://www.oracle.com/technetwork/topics/dotnet/code-154692.html

Two other things to do:

  1. Fix your connection string.

  2. Tell your OracleCommand instances you want to bind your parameters by name rather than position, using OracleCommand.BindByName = true

Suggestion: When you fix your connection string, get rid of any dependence on TNSNAMES.ORA by putting the whole connection string right in your program.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. Will try it over the weekend and let you know. I dont want to do it on a weekday because if there is an issue the whole team will suffer due to this :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.