SQLite.Net-PCL icon indicating copy to clipboard operation
SQLite.Net-PCL copied to clipboard

Returning auto-incremented Id from Insert

Open econner20 opened this issue 9 years ago • 1 comments

The ReadMe document shows the Insert() command returning an object and being able to get the primary key from the auto-incremented field (see below) , but I only see a return type of int from the SQLiteConnection.Insert() function. Did something change and is now different than the documentation? If so what is the suggest method of getting the PK from the auto-incremented insert?

public static void AddStock(SQLiteConnection db, string symbol) { var s = db.Insert(new Stock() { Symbol = symbol }); Console.WriteLine("{0} == {1}", s.Symbol, s.Id); }

econner20 avatar Jan 03 '16 04:01 econner20

I have the same question

alesdvorakcz avatar Sep 02 '16 12:09 alesdvorakcz