Mike
Mike

Reputation: 659

DataColumn.AutoIncrementSeed = -1

What does it means if AutoIncrementSeed property has value -1 ?

Upvotes: 1

Views: 807

Answers (2)

user526411
user526411

Reputation: 11

The schema of sql server table along with the data, couldn't override the AutoNumber Increment.

have to take this code out

Adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey 

Upvotes: 1

MrCraze
MrCraze

Reputation: 365

This means the new ids will start being allocated from the number -1. If it is coupled with an auto increment step of -1, the new IDs will decrease: ie, -1, -2, -3, etc. This is valuable for allocating IDs in a dataset before the dataset is saved to the actual database - the negative numbers help you easily identify unsaved records and can be automatically updated with positive IDs after the save.

Hope this helps, Steve

Upvotes: 1

Related Questions