How to get the last created or modified dataset

T

thalion77

Hello,

is there a possibility to get the ID of the last created or modified
dataset of a table via ADO.NET? Is there a database independent way?

In SQL Server you can call the scope_identity() function, but this
won't work in Oracle, MySQL, Access a.s.o.

Thanks in advance,
Norbert
 
G

Guest

Norbert,

If you are trying to retrieve the database-generated primary key value for a
newly inserted row, there is no database-independent way to do that, as far
as I know.

In SQL Server you can select scope_identity, in Access you can select
@@identity, in Oracle you need to query the appropriate sequence object, etc.

Kerry Moorman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top