Groups | Blog | Home
all groups > dotnet ado.net > october 2004 >

dotnet ado.net : C# SQL SERVER LAST INSERT ID EXAMPLES


Sheraz Khan via .NET 247
10/31/2004 3:55:55 AM
does anyone have sample code of data being inserted to a table, then the last insert id is retrived and inserted into another table.

The Code is c# and the database is SQL SERVER, NO Access examples or vb...

Thanks for this... i just cant find a simple example on this identity problem, people do try to help, but use the wrong conn types of languages..

thanks in advance

Sheraz khan
sheraz.khan@learningtrust.co.uk

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

Grzegorz Danowski
10/31/2004 1:50:21 PM
Uzytkownik "Sheraz Khan via .NET 247" <anonymous@dotnet247.com> napisal w
wiadomosci news:enWFVC0vEHA.1404@TK2MSFTNGP11.phx.gbl...
[quoted text, click to view]

The question is so popular... that I wonder why so many people ask
newsgroups instead using google. :-)
The answer is of course:
SELECT SCOPE_IDENTITY()

Regards,
Grzegorz
AddThis Social Bookmark Button