DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 25 Jul 2007 00:38:23 -0700,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    unknown
          2    Kerry Moorman


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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us