Hi
I have a c# project that uses sqlite and I wonder if there is something like the mysql_insert_id method as in php ?
Thanks
Hi
I have a c# project that uses sqlite and I wonder if there is something like the mysql_insert_id method as in php ?
Thanks
The SQLite base API (in C) has sqlite3_last_insert_rowid
which looks ideal for this sort of thing. It's also available at the SQL level via the last_insert_rowid()
function. I don't know how this maps to C#, but that should help you when looking.
For SQLite3 SELECT last_insert_rowid()
should work, as explained here: http://stackoverflow.com/questions/506132/how-to-get-last-inserted-id-of-a-sqlite-database-using-zend-db