Server: <empty> Service: sde:Oracle11g:/;LOCAL=ORADEV Database: <empty>Database connection Username: theUser Password: thePass Save username and password. Version: sde.DEFAULT Save the transactional version file name with the connection.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.DataSourcesGDB; using ESRI.ArcGIS.DataManagementTools; using ESRI.ArcGIS.Geometry; using ESRI.ArcGIS.GeoDatabaseDistributed; using ESRI.ArcGIS; using ESRI.ArcGIS.TrackingAnalyst; using ESRI.ArcGIS.Server; namespace testearc_sharp { class Program { [STAThread()] static void Main(string[] args) { IAoInitialize a = new AoInitialize(); RuntimeManager.Bind(ProductCode.Engine); try { IWorkspace ws = null; IPropertySet pPropSet = new PropertySetClass(); IWorkspaceFactory pSdeFact = new SdeWorkspaceFactoryClass(); /* * Another way, using de .sde from ArcCatalog. Same error. * pPropSet = pSdeFact.ReadConnectionPropertiesFromFile("D:/Users/ArcGISSOM/AppData/Roaming/ESRI/Desktop10.0/ArcCatalog/ORADEV.sde"); */ pPropSet.SetProperty("INSTANCE", @"sde:oracle11g:/;LOCAL=ORADEV"); pPropSet.SetProperty("USER", "theUser"); pPropSet.SetProperty("PASSWORD", "thePass"); pPropSet.SetProperty("VERSION", "sde.DEFAULT"); pPropSet.SetProperty("AUTHENTICATION_MODE", "DBMS"); ws = pSdeFact.Open(pPropSet, 0); // ### COMException ERROR ### } catch (Exception ex) { Console.WriteLine("exception occurred"); Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } Console.WriteLine("finished, press key"); Console.ReadKey(); a.Shutdown(); } } }
Solved! Go to Solution.