Autoincrement field in sql

  • Thread starter Thread starter Adam Maltby
  • Start date Start date
A

Adam Maltby

Hi,

Can anyone advise (or give example) on how I go about updating an sql tabel with that has an autoincrement field?

What I would like to do is make additions in my datagrid, and write them back and let sql2000 tae care of numbering the new rows using the autoincrementing ID column it has in the db's table.

Cheers
Adam
 
Some examples:
http://msdn.microsoft.com/library/d...cpconretrievingidentityorautonumbervalues.asp

Regards,
Grzegorz

Uzytkownik "Adam Maltby" <[email protected]> napisal w wiadomosci
Hi,

Can anyone advise (or give example) on how I go about updating an sql tabel
with that has an autoincrement field?

What I would like to do is make additions in my datagrid, and write them
back and let sql2000 tae care of numbering the new rows using the
autoincrementing ID column it has in the db's table.

Cheers
Adam


(...)
 
Set the Autoincrement property of the key column to true, set the .Seed to 0 and the the value to -1. You may want to check out Bill Vaughn's article at www.betav.com ->Articles -MSDN - Managing an @@Identity Crisis

--
W.G. Ryan, MVP

www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
Hi,

Can anyone advise (or give example) on how I go about updating an sql tabel with that has an autoincrement field?

What I would like to do is make additions in my datagrid, and write them back and let sql2000 tae care of numbering the new rows using the autoincrementing ID column it has in the db's table.

Cheers
Adam
 
the datagrid doesn't give me an option in the ide to set a key column........

I'm off to check out the info you guys gave.

Cheers
Adam
 
Uzytkownik "Adam Maltby" <[email protected]> napisal w wiadomosci
the datagrid doesn't give me an option in the ide to set a key column.......

I'm off to check out the info you guys gave.


But DataTable give you so option....
Grzegorz
 
Back
Top