You'll need an output parameter in the add stored procedure. You add this parameter in c# code same as others but define it as type output. When executing your command object it will look something like this lMyLongValue = command.executeScalar; This will set your variable to the the return value of the stored procedure. Your stored procedure will include something like this: DECLARE @ReturnValue AS INTEGER INSERT INTO xTABLE.... SET @ReturnValue = @@Identity SELECT @ReturnValue Post your code and I'll give you hand if needed. Good Luck
|