arcengine 读取oracle,在ARCENGINE下40万条数据的快速读取

在ARCENGINE下40万条数据的快速读取

仿造ARCMAP下的属性表打开,读取某层40万条数据,要么内存耗尽,要么读取很慢。但在AECMAP下试了一下,速度不慢,不知为何??主要代码:

//要素个数

int k = pFeatureLayer.FeatureClass.FeatureCount(null);

IFeatureCursor pFeatureCursor;

pFeatureCursor = pFeatureLayer.FeatureClass.Search(null, false);

long lTotalRecords = 0;

IFeature pFeature;

pFeature = pFeatureCursor.NextFeature();

string fldValue;

//while (pFeature != null)

for (int j = 0; j < k; j++)

{

if (pFeature !=null)

{

fldValue = new string[pFields.FieldCount];

for (int i = 0; i < pFields.FieldCount; i++)

{

string fldName;

fldName = pFields.get_Field(i).Name;

if (fldName == pFeatureLayer.FeatureClass.ShapeFieldName)

{

fldValue= Convert.ToString(pFeature.Shape.GeometryType);

}

else

{

fldValue[i] = Convert.ToString(pFeature.get_Value(i));

if (fldValue[i].Contains("0:00:00"))

{

string a = fldValue[i].Replace(" 0:00:00", "");

fldValue[i] = a;

}

}

}

dtGridView.Rows.Add(fldValue);

fldValue = null;

System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeature);

pFeature = pFeatureCursor.NextFeature();

lTotalRecords++;

if (lTotalRecords % 100 == 0)

{

GC.Collect();

}

}

}

System.Runtime.InteropServices.Marshal.ReleaseComObject(pFeatureCursor);

tbarTotalRecords.Text = "共有" + Convert.ToString(lTotalRecords) + "条记录";[/i][/i][/i][/i]

2017-07-12

添加评论

没有找到相关结果

已邀请:

与内容相关的链接

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值