How to specify an SDE geodatabase when calling Geoprocessor from C#

298
2
Jump to solution
05-04-2017 03:27 PM
TheodoreRakel
Occasional Contributor

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);

0 Kudos
1 Solution

Accepted Solutions
TheodoreRakel
Occasional Contributor

Turns out I had to get the proper license.  Now it works.

ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop, ESRI.ArcGIS.LicenseLevel.GeodatabaseUpdate);

View solution in original post

0 Kudos
2 Replies
TheodoreRakel
Occasional Contributor

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".

0 Kudos
TheodoreRakel
Occasional Contributor

Turns out I had to get the proper license.  Now it works.

ESRI.ArcGIS.RuntimeManager.BindLicense(ESRI.ArcGIS.ProductCode.Desktop, ESRI.ArcGIS.LicenseLevel.GeodatabaseUpdate);

0 Kudos