Re: How do you get the @@identity for the record just inserted?
Posted by: Timothy Graupmann
Date: January 23, 2005 04:08PM

Got the SELECT @@IDENTITY to work with this:

// Get Id from Insert
myCommand = myConnection.CreateCommand();
myCommand.CommandText = "SELECT @@IDENTITY";
newMeshNode.MeshNodeId =
(UInt32)(Int64)myCommand.ExecuteScalar();
if(newMeshNode.MeshNodeId == 0)
throw new Exception("Invalid MeshNodeId was assigned.");

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.