提高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();
}
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();
}
相关文章推荐
- 提高数据更新效率(UPDATE/INSERT)
- 大幅提高数据更新效率技术探究
- 提高数据更新效率(UPDATE/INSERT)
- 提高数据更新效率(UPDATE/INSERT)
- C#serialport收到数据实时插入数据库 datagridview更新一行 提高效率
- Qt插入大量数据到sqlite数据库,使用事务提升效率(效率提高的惊人)
- Android Studio开过中常用的插件,大大提高开发效率!(持续更新中)
- 利用Python进行数据分析(3) 使用IPython提高开发效率
- 合理设计数据的格式能大幅提高效率和缩短程序代码
- oracle数据库执行计划统计分析,优化表数据字典,提高sql查询效率
- Sql_使用meger语句提高数据批量操作效率
- 如何提高游戏后台数据查找效率
- 提高安卓APP开发效率、管理代码的架子(二):BaseProtocol(加载数据,访问本地, 访问服务器,保存本地)
- 处理百万级以上的数据查询提高效率的办法
- 提高 Web Service 数据传输效率的基本方法
- 大数据量时提高分页的效率
- ASP提高数据显示效率-缓存探幽
- Oracle批量查询、删除、更新使用BULK COLLECT提高效率
- Scott Mitchell 的ASP.NET 2.0数据教程之二十五:: 大数据量时提高分页的效率
- 如何提高企业数据归档解决方案的效率