I want to use the database connections that already exist in a project to extract data form specific database tables/views.
How can I do this in C#? The databases I have to connect to are Oracle databases and i was wondering if I have to install the Oracle Developer Tools for VisualStudio and establish the connection this way, or if it is possible to use sde files containing the connection properties already.
Bests Thomas
Hi Thomas -
You may want to visit the ArcGIS Pro GitHub wiki for code snippets to accomplish this task.
Please see below for link to wiki and code snippet.
Ciao,
+ bill
ProSnippets Geodatabase · Esri/arcgis-pro-sdk Wiki · GitHub
public async Task OpenEnterpriseGeodatabaseUsingSDEFilePath() { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde")))) { // Use the geodatabase. } }); }