Autoincrement field in sql

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
 
G

Grzegorz Danowski

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


(...)
 
W

W.G. Ryan eMVP

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
 
A

Adam Maltby

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
 
G

Grzegorz Danowski

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
 

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