c# - How to return the last recorded ID in access db -
i need insert record in access database , return id inserted row try use execute non query inserting execute scalar statement :
`"select @@identity`"
and return 0 time
"select scope_identity()"
throw exception !
so way issue !
scope_identity() works in sql server, not access.
you should able use select @@identity
last id - long there identity column. see microsoft kb article example: http://support.microsoft.com/kb/815629
Comments
Post a Comment