Oracle Connection Issue

17 posts, 0 answers
  1. Bruce
    Bruce avatar
    17 posts
    Member since:
    Oct 2010

    Posted 31 May 2011 Link to this post

    I'm getting the following error when trying to create a Domain Model:

    Unable to retrieve the database schema information.
    Reason: Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.20, Culture=neutral, PublicKeyToken=89b483f429c4724' or one of its dependencies.  The system cannot find the file specified.

    My project has a reference to Oracle.DataAccess.dll version 2.112.1.0 and it appears that this is the only DLL provided in ODP.NET.

    Is my newer version the cause of the problem?  Does Oracle.DataAccess.dll have a dependency that is not apparent?  Any guidance would be appreciated.
  2. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 01 Jun 2011 Link to this post

    Hi Bruce,

    You need to have ODP.NET installed on your machine, which you can download from here. The installer install's a policy file to your GAC which looks like this:

    Policy.2.102.Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=x86

    OpenAccess links against a 10.2 version of the client. The policy file redirects the version to 2.112.1.0. You can either add it manually or uninstall everything and reinstall ODP.NET. This way you will get the policy file installed automatically. You do not need the 10.x version if you have this policy file. 
    Hope this helps.

    All the best,
    Ralph
    the Telerik team
    Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
  3. DevCraft banner
  4. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 01 Oct 2011 Link to this post

    Hi Ralph,
    Please describe your solution more.
    I uninstall everything and reinstall ODP.NET 11.2.0.2.1 and have a policy you mentioned in GAC but I still have the same above error.

    Thanks
  5. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 04 Oct 2011 Link to this post

    Hello Libertad,

    Please ensure that you have the same version of the ODAC driver installed as your application is.  If you are running a x86 program please install the x86 version of the Oracle ODAC drivers. The same goes for x64.
    32 bit applications (x86 build setting) require the 32 bit ODAC ro be installed; 64 bit applications (i64 build setting) require the 64 bit ODAC version. 

    Hope that helps.

    Kind regards,
    Ralph
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

  6. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 04 Oct 2011 Link to this post

    Hello Ralph,
    I have not any problem regarding the installed ODAC driver in my development machine which is a Win7 32bit. I have this error only on production machine which runs on Windows Server 2008 R2 64bit.
    I have installed the latest version of ODAC driver 32 bit on the server which I've downloaded from here.
    Regarding my development machine OS (Win7 32bit) the build type of my application is x86 and since 32 bit of ODAC has been installed on the server, so my application should work fine on the server, but I'm getting the above mentioned error when I run my application from server.
    What do you think Ralph?
  7. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 04 Oct 2011 Link to this post

    Hello Libertad,

    I guess you are using this DLL within an IIS setup. Have you checked that your Application Pool supports 32bit applications. This can be set in the settings of the Application Pool.

    Hope this helps.

    All the best,
    Ralph
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

  8. Libertad
    Libertad avatar
    53 posts
    Member since:
    Sep 2008

    Posted 04 Oct 2011 Link to this post

    You just made my day Ralph.
    Thanks a lot
  9. Shravan
    Shravan avatar
    10 posts
    Member since:
    Dec 2010

    Posted 19 Dec 2011 Link to this post

    I have a similar issue, but I want to downgrade instead from Oracle 11g Data Provider to Oracle 10g Data Provider for our prod. I am using Telerik.OpenAccess.dll ver2011.02. I get the same error specified here above and am seeking a quick solution.

    Thanks,
    Shravan
  10. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 20 Dec 2011 Link to this post

    Hi Shravan,

    I'm not sure, if I understood what your problem is, but if you face the same problem regarding the x86 drivers and you are in an IIS environment, then you can also enable support for 32Bit applications for your App pool. 
    You can use the Version 10.2 or higher of the ODP.net driver with Telerik OpenAccess ORM. Your downgrade should not be the reason for such an error.

    I hope this information is useful for you. Do not hesitate to contact us if you need further assistance or you have other questions.

    Greetings,
    Ralph
    the Telerik team

    Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

  11. Shravan
    Shravan avatar
    10 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2011 Link to this post

    Nopes, its not working(10.2 client for 11g via ORM).

    I cleaned up my computer from all previous installations of Oracle and Telerik ORM. Then installed Oracle 10.2 Client Win32 runtime components (and even Instant Client and even Custom configuration), updated my tnsnames.ora, I could only create a new connection to my Oracle server using either Oracle Data Proider .NET or .NET Data Provider for Oracle in Telerik ORM Q3 2011, but in the next screen in Choose database items on New Domain Model Wizard, I still get the error Could not load file or assembly 'Oracle.DataAccess, Version=2.102.2.0....The system cannot find the file specified. I see that I have got Oracle.DataAccess.dll ver10.2.0.100 installed in GAC and also the Policy.9.2.Oracle.DataAccess.dll ver10.2.0.100. I could even use VS2010 Server Explorer to query my Oracle database. I even switched to x86 build. But, I just can't use Telerik ORM to work with Oracle 11g using 10g client. Is there anything that I am not aware of?

    I appreciate your response.

    Thanks,
    Shravan.
  12. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 20 Dec 2011 Link to this post

    Hi Shravan,

    Can you please check your machine.config file (mine is located at C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config), if you have an entry similar to the following under the DbProviderFactories node? 

    <add name="Oracle Data Provider for .NET" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET" type="Oracle.DataAccess.Client.OracleClientFactory, Oracle.DataAccess, Version=4.112.2.40, Culture=neutral, PublicKeyToken=89b483f429c47342" />

    You should have an entry depending on the client you have installed.

    I really hope you get your application running with this entry.
    Best wishes,
    Ralph
    the Telerik team

    Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

  13. Shravan
    Shravan avatar
    10 posts
    Member since:
    Dec 2010

    Posted 20 Dec 2011 Link to this post

    Can I have 11g Client on my developer PC and 10g on Prod? Could you explain how to do this?

    Thanks,
    Shravan
  14. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 21 Dec 2011 Link to this post

    Hello Shravan,

    Since you don't have to add any reference to the ODP.net assemblies in your project, you can simply deploy you application to the production environment without any additional efforts. The respective driver is resolved through the entries in the machine.config on the hosting system. We are assuming that the driver was installed on that system before, so the respective entries should be there.
    Therefore it is possible to have a 11g client on your dev machine and a 10g client on your prod machine.

    All the best,
    Ralph
    the Telerik team

    Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

  15. uugaa
    uugaa avatar
    2 posts
    Member since:
    Dec 2011

    Posted 22 Feb 2013 Link to this post

    i'm follow this blog sample code http://alderprogs.blogspot.com/2009/04/deploying-odpnet-with-oracle-instant.html


    static void Main(string[] args) {
    OracleConnection conn = new OracleConnection("User Id=scott;Password=tiger;Data Source=machine_name/service_name");
    conn.Open();
    OracleCommand cmd = new OracleCommand("select sysdate from dual", conn);
    DateTime dtm = (DateTime)cmd.ExecuteScalar();
    Console.WriteLine("Database time is {0}", dtm.ToString("F"));
    cmd.Dispose();
    conn.Dispose();
    }

    this is code good work

    my project openaccess orm using
    this exception error
    Could not load file or assembly Oracle.DataAccess

    i'm odac install windows xp sp3 32bit comuuter run application is werry good work.

    odac never install any computer run my project?
     my requirement:  never install oracle client  and run my project 

    sorry my bad english :P

    tnx

  16. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 25 Feb 2013 Link to this post

    Hi uugaa,

    Can you please ensure that your Oracle.DataAccess dll platform version matches your project's platform.
    For an x86 platform, you need the x86 Oracle.DataAccess assemby. Same goes for x64. In case your project is configured to use Any CPU, then you need the platform of your OS.

    I hope this helps.
    Do come back in case you need further assistance. 

    All the best,
    Ralph
    the Telerik team
    Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
  17. uugaa
    uugaa avatar
    2 posts
    Member since:
    Dec 2011

    Posted 25 Feb 2013 Link to this post

    tnx
    my project platform X86 debug

    my solution app.config file add this config add good work any other computer

    <system.data>
        <DbProviderFactories>     
            <add name="Oracle Data Provider for .NET"
                    invariant="Oracle.DataAccess.Client"
                    description="Oracle Data Provider for .NET"
                    type="Oracle.DataAccess.Client.OracleClientFactory,
                      Oracle.DataAccess,
                      Version=2.112.3.0,
                      Culture=neutral,
                      PublicKeyToken=89b483f429c47342" />      
        </DbProviderFactories>
      </system.data>
  18. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 25 Feb 2013 Link to this post

    Hello uugaa,

    I was following the example link provided by you and based on this I have created two sample applications that use this approach. One via the way from the link, the other via OpenAccess.
    For the attached packaged, I have removed all the Oracle dlls. To run this project, please add them as described in your link. This should be done in the OAXCopy and in the OracleXCopy test project. Also please adjust the connection strings and Oracle.DataAccess version informations appropriately.
    With this I was able to connect to the oracle database via the direct connection approach and via OpenAccess.
    Can you try if this also works in your environment?
    Have you ensured in your application that you have the appropriate versions of the assemblies? What exceptions are you getting on your side?

    I hope the sample application is useful for you.
    Do come back in case you need further assistance.

    Greetings,
    Ralph
    the Telerik team
    Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Back to Top
DevCraft banner