An element in a dataset I am working with is an integer datatype, with autoincrement set to "True". The idea is that this field is a unique ID for each entry in the database, which is saved as an XML file. This is not an SQL database.
If I open my application with the relevant XML loaded into the dataset, the autonumber field picks up as expected, however if I switch XML sources (load a different set of data based on the same schema) whilst the application is running, the ID field for the new entry starts from the last number of the previous dataset. I am unable to reset the autoincrement seed value manually (by resetting the autoincrement seed value etc), though I am clearing the dataset ( ds.clear() ) prior to loading in the new XML data.
Short of ditching the autoincrement feature altogether and manually allocating a unique ID to each record, is there any other way of achieving the desired result, i.e an autoincrement value that picks up from the last record? All the advice I have found seems to relate to using autoincrement with an SQL based system, which I can't seem to relate to my application.
A workaround would be to automatically restart the application when I load a new XML database, but that seems like the equivalent of using a hammer to do precision work...
Thanks,
Tim
If I open my application with the relevant XML loaded into the dataset, the autonumber field picks up as expected, however if I switch XML sources (load a different set of data based on the same schema) whilst the application is running, the ID field for the new entry starts from the last number of the previous dataset. I am unable to reset the autoincrement seed value manually (by resetting the autoincrement seed value etc), though I am clearing the dataset ( ds.clear() ) prior to loading in the new XML data.
Short of ditching the autoincrement feature altogether and manually allocating a unique ID to each record, is there any other way of achieving the desired result, i.e an autoincrement value that picks up from the last record? All the advice I have found seems to relate to using autoincrement with an SQL based system, which I can't seem to relate to my application.
A workaround would be to automatically restart the application when I load a new XML database, but that seems like the equivalent of using a hammer to do precision work...
Thanks,
Tim