Get dataset new row primary key value

  • Thread starter Thread starter DotNetJunkies User
  • Start date Start date
DotNetJunkies,

You will have to re-query the data in order to get this. What you could
do is select the identity value ("select @@identity") to get the last
inserted identity value. Of course, this should be done in a transaction in
order to assure that you get the correct one. You can also use
SCOPE_IDENTITY as well, as it should give you the last identity value
inserted in the current scope.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)


DotNetJunkies User said:
How can I get after a dataset update the new row primary key value???
engine supports Post Alerts, Ratings, and Searching.
 
So there is no way after an update on dataset then on the db to get this
like this for example
iMemberId = (int) oDataSet.Tables[0].Rows[0]["Id"];

Thanks In advance.
DotNetJunkies User said:
How can I get after a dataset update the new row primary key value???
engine supports Post Alerts, Ratings, and Searching.
 
Back
Top