DataTable AutoNumber Seed

N

Nitin

I have a field in a DataTable with its AutoIncrementSeed = 1 and and
AutoIncrement='True' when I remove all the rows from the Table how can I
reset the Autonumber field's seed to 1 so that it forgets its previous
autonumber value and starts fresh from 1
Regards,
Nitin
 
C

Cor Ligthert

Nitin,

Just an advice, forget the autoseed if that is possible and start using
GUID's for the uniqueidentifier, that will probably make your life a lot
happier.

Just my thought,

Cor
 
D

Daniel

You need to compact the database to restart the autonumber. I do not know
the command for it in .NET though
 
C

Cor Ligthert

Daniel,

Your answer is about the database itself not in the datatable.

(In the datataset you need to do a clear of the datatable and to fill that
table again).

Nothing wrong with your answer, just to make it clear.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top