ArcEngine 异常 :The index passed was not within the valid range.

pRowBuffer.set_Value(pFds.FindField("W_Mean"), Re_mean[3]);

此句代码弹出异常:The index passed was not within the valid range. 翻译为传递的索引不在有效范围

起初以为3超出了范围,多次修改实验,一直弹出这个错误。

搜索这个异常的时候,官网的资料是 Geocoding a table with blank values in the adress field genetates the error message;

自己翻译了一下,以为是Re_mean[3]的值的问题,所以将值改为其他,结果还是这个错误。

怀疑是FindFiled时没有找到这个name,将name多次对比,发现一样的。然后输出找到的索引,也是正常的。

折腾了一晚上,发现原来是创建Row的时候用的是另一张表!!!!

尼玛,大脑一时短路,折腾了一晚上!

原文地址:https://www.cnblogs.com/DayDreamEveryWhere/p/3574291.html