QueryDataSet returns only 50 rows, why?

概要: QueryDataSet returns only 50 rows, why?

Question: Why does my QueryDataSet show only 50 rows when using a DataStore component?

At design time, the StorageDataSet.MaxDesignTimeRows is set to 50. So if the query was initially run in the designer, you got 50 rows. If you restart your application, the StorageDataSet using the DataStore knows it already has data (the 50 rows from design time), so the provider query does not need to be executed. To force the query to be re-executed at run time call QueryDataSet.executeQuery(), or QueryDataSet.refresh().

MemoryStore actually behaves much the same way if you open/close/open a QueryDataSet: it does not execute the query on the second open. The difference is that DataStore remembers its data, so that when you restart the application it does not think it needs to execute the query again, because it already has data.