如何重置下一个更改的数据行的位置?

时间:2014-07-22 13:03:31

标签: axapta

我想在选定数据行上进行循环,而无需一次又一次地选择它们。所以我想把行设置回起始位置。代码应如下所示:

Table table;
select * from table where …;
while(table)
{
    info(table.stringColumn);
    next table;
}
somehow reset table position 
//start from first selected row
while(table)
{
    info(table.stringColumn);
    next table;
}

我该怎么做?

1 个答案:

答案 0 :(得分:3)

我会使用QueryRun及其方法reset

但是,如果您只是想在已经检索到数据后再次从数据库中获取数据,则可以将所有检索到的记录存储在RecordLinkList中,在线提供更多信息:http://msdn.microsoft.com/en-us/library/recordlinklist.aspx

如果您需要QueryRunRecordLinkList的代码示例,请告知我们,我会将其添加到答案中。

P.S。如果您只对示例中的stringColumn感兴趣,只需将其值存储在容器或List中,然后在需要时将其存储。