在UWP

时间:2016-02-03 18:15:00

标签: sqlite uwp

我为UWP安装了SQLite,并且效果很好。

[PrimaryKey,AutoIncrement]
    public int ID { get; set; }
    public string Content { get; set; }

    path = System.IO.Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
    conn = new SQLite.Net.SQLiteConnection(new SQLite.Net.Platform.WinRT.SQLitePlatformWinRT(),path);
    conn.CreateTable<Message>();

var add = conn.Insert(new Customer() { Name = textBox.Text });

我启动模拟器,在文本框中插入内容,添加按钮以及我可以显示的其他按钮,我在那里写的内容。但是,当我关闭模拟器并重新启动应用程序时,单击“显示”按钮,没有任何内容。因此数据仅保存到数据库关闭。但是在关机后我也需要这些数据。如何永久保存数据? 感谢

0 个答案:

没有答案
相关问题