I'm using ArcGIS 10.2.1. I'm writing a C# console application that calls the Geoprocessor in order to execute the FeatureClassToFeatureClass tool. This works fine when I'm using a file geodatabase. However, I want to use an SDE geodatabase. I can't seem to get the output_path specified correctly. I keep getting exceptions and the FeatureClassToFeatureClass tool does not create a new feature class. The code is shown below. If I use a file geodatabase path for the in_features and out_path, like "C:\data\Test.gdb", then the GP.Execute tool runs fine. I seem to be specifying the out_path and possibly the out_name incorrectly when using an SDE geodatabase, but I'm don't know the proper format.
GP = new Geoprocessor();
FeatureClassToFeatureClass fcTofc = new FeatureClassToFeatureClass();
fcTofc.in_features = @"Database Connections\gistest.sde\ARCGIS.SEP";
fcTofc.out_path = @"Database Connections\gistest.sde";
fcTofc.out_name = "SEP_copy";
GP.Execute(fcTofc, null);
Solved! Go to Solution.
Turns out I had to get the proper license. Now it works.
ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop, ESRI.ArcGIS.LicenseLevel.GeodatabaseUpdate);
It looks like I have a license issue. Examining the GP messages, I see "The application is not licensed to create or modify schema for this type of data".
Turns out I had to get the proper license. Now it works.
ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop, ESRI.ArcGIS.LicenseLevel.GeodatabaseUpdate);