Getting last Insert ID

  • Thread starter Thread starter Totto
  • Start date Start date
T

Totto

Hi,
I'm using a Access database with a dot.net application. To get last insert
Id(Autogenerated) from a specific tabel, I have used
"Select Max(Id) from table" to populate a datareader. I then use
"Reader.getint32" to get the id. This works fine when there is something in
the tabel. But when the table is empty I get a cast error, obviusly since
the Getint32 returns nothing. Is there a better way to get Last insert Id
from a Access database ?

TNX
Totto
 
Back
Top