Returns the last inserted autoincremented field value in the current connection.
Syntax
DB.LastId()
Arguments
No arguments.
Return value
Returns the last inserted autoincremented field value in the current connection.
dynamic data = XVar.Array();
data["make"]="Toyota";
data["model"]="RAV4";
data["price"]=16000;
DB.Insert("cars", data);
// get the ID of the inserted record and print it on the page
MVCFunctions.Echo(DB.LastId());
See also:
•Database API: SetConnection()