Hi Guys
I have a stored procedure where I am adding a new record to a table and I have RETURN SCOPE_IDENTITY() at the end...on testing it returns the ID value that I want. However I want to be able to use this ID value and pass it to a variable within my C# code which I could then use to pass into another stored procedure to add data to a new table.
command.ExecuteNonQuery();
command.ExecuteScalar();
i_VehicleID = (int)command.ExecuteScalar();
The code snippet above shows how I have tried to store the integer value in a variable.
I would be so grateful for some assistance :)
Elmo_loves_you
Junior Poster in Training
85 posts since Mar 2008
Reputation Points: 30
Solved Threads: 0