I cannot get the last inserted identifier from my SQL Server 2000 db using a typed dataset in asp.NET
I created a tableadapter and I marked "Refresh data" and "Create insert, update and delete statements". This automatically generates the Fill and GetData methods, as well as the Insert, Update, Select, and Delete statements.
I tried all possible solutions in this thread
http://forums.asp.net/t/990365.aspx
but I still have not succeeded, it always returns 1 (= the number of rows affected). I do not want to create a separate insertion method, since the automatically created insertCommand is great for my needs.
As suggested in the thread above, I tried updating the InsertCommand SQL syntax to add SELECT SCOPY_IDENTITY () or something similar, I tried to add a parameter of type ReturnValue, but all I get is the number of rows affected.
Does anyone have another thing? Thank you in advance! Stein
source
share