How to get the last created or modified dataset
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
Date:Wed, 25 Jul 2007 00:38:23 -0700
Author:
|
RE: How to get the last created or modified dataset
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
"thalion77@graffiti.net" wrote:
> 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
>
>
Date:Wed, 25 Jul 2007 08:34:03 -0700
Author:
|