Export FeatureClass to SDE-Connection

11-12-2012 02:06 AM
New Contributor III
Hello together,
I have a problem in my arcobjects application.
I'm trying to develop a web-based application using arcobjects.
For that reason i use the server-license.
Because of that my I cannot export feature-classes to a sde-connection. When i try this, i get the following exception:

Die COM-Klassenfactory für die Komponente mit CLSID {4147A362-EFC4-11D3-A0A4-00C04F6BC626} konnte aufgrund des folgenden Fehlers nicht abgerufen werden: 80040111.

That is my code to export the featureclass:
public void ExportFeatureClass(string strLayerName, IFeatureClass pFeatureClass, IFeatureWorkspace pOutWorkspace, ISpatialReference pSpatialReference, IGeometryDef pGeometryDef)
                IFeatureClassName pInFeatureClassName = default(IFeatureClassName);
                IDataset pDataset = default(IDataset);
                IWorkspaceName pOutWorkspaceName = default(IWorkspaceName);
                IFeatureClassName pOutFeatureClassName = default(IFeatureClassName);
                IDatasetName pDatasetName = default(IDatasetName);
                IExportOperation pExportOperation = default(IExportOperation);
                IWorkspace pInWorkspace = default(IWorkspace);

                pDataset = (IDataset)pFeatureClass;
                pInFeatureClassName = (IFeatureClassName)pDataset.FullName;
                pInWorkspace = pDataset.Workspace;
                pDataset = (IDataset)pOutWorkspace;
                pOutWorkspaceName = (IWorkspaceName)pDataset.FullName;

                pOutFeatureClassName = new FeatureClassNameClass();
                pDatasetName = (IDatasetName)pOutFeatureClassName;
                pDatasetName.Name = strLayerName;
                pDatasetName.WorkspaceName = pOutWorkspaceName;

                var queryFilter = new QueryFilterClass();
                queryFilter.SubFields = "*";
                queryFilter.WhereClause = "";

                pExportOperation = new ExportOperation();

                pExportOperation.ExportFeatureClass((IDatasetName)pInFeatureClassName, queryFilter, null, pGeometryDef, pOutFeatureClassName, 0);

                pInFeatureClassName = null;
                pDataset = null;
                pOutWorkspaceName = null;
                pOutFeatureClassName = null;
                pDatasetName = null;
                pExportOperation = null;
                pInWorkspace = null;
            catch (Exception ex)
                sw.WriteLine("Export " + ex.Message + " " + ex.StackTrace);
My idea is, that the interface IExportOperation is not available for the server license.
Is there any other possibility for exporting or saving a featureclass to a sde-connection?

Thanks in advance.
0 Kudos
0 Replies