Can you explain exactly how the system.db.Refresh() is supposed to work? I assumed it would refresh immediately, but maybe I’m doing something wrong. Here is some sample code (one of the column names in the dataset is “Monitor”, and the name of the dataset is “Update” and is a dynamic property of the root container):
pds=system.dataset.toPyDataSet(event.source.parent.Update) print pds['Monitor'] system.db.runUpdateQuery("UPDATE IOStatus SET Monitor = Monitor + 1 WHERE MachineID = 1020") print system.db.runScalarQuery("SELECT Monitor FROM IOStatus WHERE MachineID = 1020") table = event.source.parent system.db.refresh(table,"Update") pds=system.dataset.toPyDataSet(event.source.parent.Update) print pds['Monitor']
This is on a ‘button press’ event, and for instance it will return 9,10,9 for the first click, and 10,11,10 for the second. I have polling turned off on the dataset, so I know it’s the refresh function that is updating the dataset, but I would have thought it would take effect immediately. Is this how it’s supposed to work?