首页 / 浏览问题 / 组件GIS / 问题详情
iObjects .net导出gdb偶然性导出失败
20EXP 2023年03月16日
public override List<DataExchangeResult> ExportData(string path, List<Dataset> exportDatasets, VCTVersion version = VCTVersion.LANDUSE_VCT30)
        {
            List<DataExchangeResult> resultList = new List<DataExchangeResult>();
            try
            {
                DataExport dataExport = new DataExport();
                ExportSettingFileGDBVector exportSetting = new ExportSettingFileGDBVector();
                exportSetting.SourceDatas = exportDatasets.ToArray();
                exportSetting.IsOverwrite = true;
                exportSetting.TargetFileType = FileType.FileGDBVector;
                exportSetting.TargetFilePath = path;
                exportSetting.IgnoreFieldNames = new string[2] { "UserID", "SmUserID" };//WZJ
                dataExport.ExportSettings.Add(exportSetting);
                ExportResult result = dataExport.Run();
                dataExport.Dispose();
                DataExchangeResult exchangeResult = new DataExchangeResult();
                exchangeResult.ExchangeType = ExchangeType.Export;
                if (result.FailedSettings.Length > 0)
                {
                    exchangeResult.IsSuccee = false;
                }
                if (result.SucceedSettings.Length > 0)
                {
                    exchangeResult.IsSuccee = true;
                }
                resultList.Add(exchangeResult);
            }
            catch(Exception ex)
            {
                m_log.Debug(ex.Message, ex);
                return null;
            }
            return resultList;
        }

我使用这段代码将数据集导出为gdb,有的电脑上导出成功,有的电脑上导出失败,请问导出gdb是缺少什么引擎吗

1个回答

您好,导出gdb不需要什么其他的操作,建议您查看导出时是否有重名的文件。

希望可以帮助到您!
2,548EXP 2023年03月16日
好吧,重不重名得不影响吧,我给设置IsOverwrite = true了,重名了会覆盖得
...