最后在sqlite中为xamarin android插入行ID

时间:2015-11-16 04:19:04

标签: sqlite xamarin rowid

这是我在数据库代码中的插入。如何在插入后返回最后一个插入rowid?我正在使用Xamarin.Android,谢谢

public void checkDays(int medID, int mon, int tue, int wed, int thu, int fri, int sat, int sun)
        {
            try{
                sqldb_query = "INSERT INTO Days (medicationID, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) VALUES ('" + medID + "', '" + mon + "', '" + tue + "', '" + wed + "', '" + thu + "', '" + fri + "', '" + sat + "','" + sun + "');";
                sqldb.ExecSQL(sqldb_query);
                //msg = "Record Saved";
            }catch(Android.Database.Sqlite.SQLiteException e){
                //msg = "No " + e.Message;
                throw(e);
            }
        }

0 个答案:

没有答案