Subject | Performance improvements when refreshing a dataset |
---|---|
Author | Robert Martin |
Post date | 2015-02-16T21:18:33Z |
Hi
I have a query where sometimes I need to refresh the selected record (A)
and other times where I know and item has been added (by another
process) and I need to refresh and select this item (B).
Historically I have simply done the following (depending on the situation)
(A) Query.Refresh
(B) Query.Refresh followed by Query.Locate()
I have replaced (A) with the following
(A) Query.InvalidateRowNum(Query.InternalDataset.RowNum)
This is massively quicker on large datasets.
I would like to speed up (B) if possible, but am not sure how to go
about this. I don't need to refresh all the other records, I just need
to add the new record into the dataset and move to it. My code knows
the Primary key field value of the newly added record. I am using IBOQuery.
Any suggestions ?
Thanks
Rob
I have a query where sometimes I need to refresh the selected record (A)
and other times where I know and item has been added (by another
process) and I need to refresh and select this item (B).
Historically I have simply done the following (depending on the situation)
(A) Query.Refresh
(B) Query.Refresh followed by Query.Locate()
I have replaced (A) with the following
(A) Query.InvalidateRowNum(Query.InternalDataset.RowNum)
This is massively quicker on large datasets.
I would like to speed up (B) if possible, but am not sure how to go
about this. I don't need to refresh all the other records, I just need
to add the new record into the dataset and move to it. My code knows
the Primary key field value of the newly added record. I am using IBOQuery.
Any suggestions ?
Thanks
Rob