Select to view content in your preferred language

Connecting to an external Oracle database

959
3
07-30-2019 01:17 PM
BryanLynn1
Occasional Contributor

I need to connect to an external data table through the Oracle.ManagedDataAccess control. I installed it from the NuGet package for the latest version but I always get the following error:

 

System.IO.FileNotFoundException: 'Could not load file or assembly 'Oracle.ManagedDataAccess' or one of its dependencies. The system cannot find the file specified.'

 

I have tried connecting from within Pro. I have tried in an await and outside of an await function. I have tried to create a class DLL and reference it to the project. All of these return the same error FileNotFound. I know the Oracle driver works because I have tested it in other non ArcGIS Pro apps.

 

Using ArcGIS Pro 2.4; Visual Studio 2017; and Oracle.ManagedDataAcess version 4.122.19.1

 

Thanks.

FYI - this may appear as a duplicate posting but the first one was accidentally posted as a "Discussion" and not a question.

Tags (2)
0 Kudos
3 Replies
RichRuh
Esri Regular Contributor

Bryan,

I don't know the answer to your question about how to use the Oracle.ManagedDataAccess control inside a Pro add-in.  I'm not familiar with the control.

An alternate implementation you might consider is to use the Database class from the Pro SDK.  This allows you to directly access relational databases that may or may not be ArcGIS geodatabases.

--Rich

0 Kudos
BryanLynn1
Occasional Contributor

I have been using the Geodatabase class to access a feature class and get info. However, the performance is horrible!! I was hoping to use the Oracle.ManageDataAccess control to go straight against the database views and hopefully get better performance (this is what I have done in my ArcMap Add-Ins and the performance is great). I will look at the Database class but I assume it will be the same on a performance level.

When I say bad performance here is an example. I am looking up a subdivision by object id. In ArcMap it takes less than a second to locate and highlight the subdivision in the map - basically I click the OK button and it shows up. In Pro, it takes close to 3 seconds to highlight the subdivision in the map. It isn't just the subdivision feature class either, I have seen this same type of performance with other feature classes. I am currently drawing nothing in the map - just highlight the subdivision. In this example, I am not using the Oracle.ManagedDataAccess class I am using the Geodatabase class in Pro SDK or ArcObjects for ArcMap. I am experiencing the same slowness with other simple database type queries where I only want attribute info which is why I wanted to try the Oracle data provider. My preference is to stick with ArcGIS Pro SDK objects and controls.

Is this behavior typical? If so, I will move on, finish the code, and live with the poor performance. If not, I would like to build it right the first time.

Thanks.

0 Kudos
BryanLynn1
Occasional Contributor

Here is a quick video to show the performance I am seeing in Pro vs ArcMap.

0 Kudos