Key 'DatabaseOracleODP' is not found!

Stimulsoft Reports.NET discussion
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Key 'DatabaseOracleODP' is not found!

Post by gunde99 »

• Product name and its version;
Stimulsoft Report.NET version 2012.3
Visual Studio 2010 (C#)

• Detailed description of the problem and how to reproduce it;
Extract the zip-file: C:\Program Files (x86)\Stimulsoft Reports.Net\Adapters\OracleODPDatabase.zip
Open in VS2010 and convert the project
Add reference to all Stimulsoft .dll's
Add reference to Oracle.DataAccess.dll (v. 4.112.3.0)
Build the .dll for Framework 4.0
Copy both Oracle.DataAccess.dll and Stimulsoft.Report.OracleODP.dll to C:\Program Files (x86)\Stimulsoft Reports.Net\Bin\
Run C:\Program Files (x86)\Stimulsoft Reports.Net\Bin\Designer.exe
Add connection, Oracle ODP, press Build-button and get the error:

System.BadImageFormatException: Could not load file or assembly 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. Ett försök att läsa in ett program med ogiltigt format gjordes.
File name: 'Oracle.DataAccess, Version=4.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342'


• Your operational system (98, ME, 2000, XP, Vista or 7), its version and localization, installed service-packs;
Windows 7 Professional, x64, Service Pack 1

• Version the of Microsoft .Net Framework package installed and its localization;
All frameworks up to v4.0.30319 installed

• Version of Oracle ODP.NET provider
11.2.0.3

• Additional information that can help us to solve your problem.
I've attached the .dll files I'm using

Thanks!
Attachments
StimulsoftODP.zip
(369.43 KiB) Downloaded 888 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Key 'DatabaseOracleODP' is not found!

Post by Alex K. »

Hello,

Please clarify which version of Oracle do you use?
Under x64 you need use x64 Oracle client.

Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Key 'DatabaseOracleODP' is not found!

Post by gunde99 »

OK, it worked with a 64 client but now I have trouble using the mrt-file in my WinForms C#-project.

I created a new report-file and connected it with ODP to an Oracle table. Preview went fine but I tried to load the file from my application and it gave me this error:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I've attached both the report.mrt and the scripts to create the table and fill it with some data.
Attachments
Report and data.zip
(2.11 KiB) Downloaded 504 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Key 'DatabaseOracleODP' is not found!

Post by Alex K. »

Hello,

Can you please describe your issue in more details.
Can you please show us your code for load and show report in your application.
Also please check that the OracleODPDatabase adapter added to reference of your project and in service:

Code: Select all

StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleODPAdapterService());
StiConfig.Services.Add(new Stimulsoft.Report.Dictionary.StiOracleODPDatabase());
Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Key 'DatabaseOracleODP' is not found!

Post by gunde99 »

I've attached the project and it is using the report attached in previous post. I've managed to get it work for 64-bit but not with a 32-bit provider.

The problem is that I'm developing on a 64-bit Windows 7 but I wan't to be able to deploy the software in various environments (both 64 and 32-bit). How can this be done?
Attachments
RapportTest.zip
(12.67 MiB) Downloaded 468 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Key 'DatabaseOracleODP' is not found!

Post by Alex K. »

Hello,

Also please send your .mrt file for analysis.

Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Key 'DatabaseOracleODP' is not found!

Post by gunde99 »

It's the same mrt file as before. I've created a mrt-file with a 64-bit ODP-provider but since I load it into a 32-bit application I thought it could work. Do I have to create two different files? How can I create a mrt-file that works with a 32-bit ODP-provider on a 64-bit Windows.
Attachments
Report and data.zip
(2.11 KiB) Downloaded 467 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Key 'DatabaseOracleODP' is not found!

Post by Alex K. »

Hello,

According to the idea the x64 client version is required if you are using the application compiled with a compiler directive "x64". Try to compile your application with directive "x32" or "any cpu".
Also you are using in your code the following line:

Code: Select all

((StiSqlDatabase)report.Dictionary.Databases[0]).ConnectionString = "User Id=NOVA;Password=NOVA;Data Source=XE;Persist Security Info=True";
This is not true. In this case, you must use the following code to change the connection string:

Code: Select all

((StiOracleODPDatabase)report.Dictionary.Databases[0]).ConnectionString = "User Id=NOVA;Password=NOVA;Data Source=XE;Persist Security Info=True";
Thank you.
gunde99
Posts: 27
Joined: Tue Jul 31, 2012 11:23 am

Re: Key 'DatabaseOracleODP' is not found!

Post by gunde99 »

Sorry. It was my stupid mistake. I had the x86 configuration targetting the x64-platform. It's all working perfectly now. Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Key 'DatabaseOracleODP' is not found!

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
Post Reply