Hi
I have a table using autoincrement in column 1 (primary key).
And i have a button to reload the table. The button deletes all the rows from the table and Re-add them into the same table.
i use protocol.NotifyProtocol(156 /*Delete row*/, tableID, Pkey) to delete the rows from the table.
Then i use protocol.NotifyProtocol(149 /*Add new row*/, tableID, null) to re-add and use SetParameterIndex to fill the cell of the row.
The delete row and re-add row works all fine.
However, the only problem i have is:
seems the primary key (autoincrement) somehow didn't get reset to 1 when i delete all the rows from the table. When i re-add the rows in, the primary key value increase from the last deleted value.
e.g.,
I added 4 rows. the autoincrement primary key will be:
1,
2,
3,
4,
Then I reloaded the table, all 4 rows were deleted from the table. And the 4 rows were re-added into the same table. But the primary key start from 5.
5,
6,
7,
8
How can i reset the autoincrement primary key back to 1 when i delete all the rows from the table?
Thanks