您的位置:首页 > 其它

提高ITable数据更新效率

2012-09-28 15:45 288 查看
一般更新ITable的数据,最常用的更新方法是这样更新(一条一条更新,不是批量更新)。

ITable tTable = (ITable)_CurFeatureClass;

ICursor tCursor = tTable.Search(null, true);

IRow tRow = tCursor.NextRow();

while (tRow != null)

{

tRow.set_Value(1, "aa");

tRow.Store();

tRow = tCursor.NextRow();

}

这种方法更新数据的效率很低.所以最好用下面的方法去更新,效率会高很多.

ITable tTable = (ITable)_CurFeatureClass;

ICursor tCursor = tTable.Update(null, true);

IRow tRow = tCursor.NextRow();

while (tRow != null)

{

tRow.set_Value(1, "aa");

tCursor.UpdateRow(tRow);

tRow = tCursor.NextRow();

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: