What is the Best way to fetch the most recent updated row in a database

  • Thread starter Thread starter jagrat
  • Start date Start date
J

jagrat

I am having an OleDBDataAdapter and a dataset. I fill the dataset with
a row and execute

Adapter.update(dataset,"Table Name");
Adapter.fill(dataset,"Table Name");

For the database table, my primary key is an auto number.

Currently, I am fetching the key using:

dataset.Tables["Table Name"].Rows[0].ItemArray[0]

It is working because this is the only row added into my table.
But I am certain that there should be a better alternative to this.
Waiting for response.

Jag
 
Hi,

Check out
Retrieving Identity or Autonumber Values
..net help topic.
MSDN Oct link
(ms-help://MS.VSCC.2003/MS.MSDNQTR.2004OCT.1033/cpguide/html/cpconretrievingidentityorautonumbervalues.htm)
 
Back
Top