How to use existing database connections in a project?

310
1
12-20-2018 04:25 AM
ThomasBecker
New Contributor

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

Tags (1)
0 Kudos
1 Reply
by Anonymous User
Not applicable

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  

Opening an Enterprise Geodatabase using sde file path

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.    }   }); }
0 Kudos