Does SQLite have something like insert_id?
I have a c# project that uses sqlite and 开发者_JS百科I wonder if there is something like the mysql_insert_id method as in php ?
Thanks
For SQLite3 SELECT last_insert_rowid()
should work, as explained here: how to get last inserted Id of a Sqlite database using Zend_Db
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.
精彩评论