【问题标题】:How to add SQLiteDataAdapter in UWP C#如何在 UWP C# 中添加 SQLiteDataAdapter
【发布时间】:2019-02-14 18:09:49
【问题描述】:

SQLiteDataAdapter 或任何其他选项的程序集参考是什么?

public void Load(ItemsControl control, string commandText)
{
    try
    {
        _db.OpenConnection();

        using (SQLiteDataAdapter dataAdapter = new SQLiteDataAdapter(commandText, _db.Connection))
        {
            DataTable dataTable = new DataTable();
            dataAdapter.Fill(dataTable);
            control.ItemsSource = dataTable.AsDataView();
        }
    }
    catch (Exception exp)
    { }
}

【问题讨论】:

标签: c# sqlite uwp


【解决方案1】:

在UWP中,如果你想使用sqlite数据库,微软建议你使用Entity Framework Core或者微软开源的SQLite library

我检查了 SQLite 库,里面没有 SQLiteDataAdapter 类。

所以,请按照官方文档Use a SQLite database in a UWP app 在您的 UWP 应用中使用 sqlite。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-22
    • 2018-04-08
    • 2016-04-08
    • 2020-01-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多