Unity用android创建sqlite

时间:2017-05-19 15:09:28

标签: c# android sqlite unity3d unity2d

我试图在android中创建一个sqlite数据库,但是当我在手机中尝试这个时,永远不会创建数据库......

static void obrirConn () {

        dbconn = (IDbConnection)new SqliteConnection ("URI=file:" + Application.persistentDataPath + "/Timmy_Game.db");

        dbconn.Open(); //Open connection to the database.
        dbcmd = dbconn.CreateCommand();

        dbcmd.CommandText = "create table IF NOT EXISTS `nivells` (`id` INTEGER NOT NULL UNIQUE, `temps` INTEGER, `puntuacio` INTEGER, PRIMARY KEY(`id`));";
        dbcmd.ExecuteNonQuery();

    }

0 个答案:

没有答案