0

我正在使用Sqlite3并将引用添加到我的 Windows 商店应用程序并尝试创建一个数据库,如下所示:

C:\Sqlite3>Sqlite3 mydata.db

接下来尝试从我的代码隐藏创建表,如图所示:

 Try
     Dim dbpath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "mydata.db")
       Using db = New SQLite.SQLiteConnection(dbpath)
       ' Create the tables if they don't exist
        db.CreateTable(Of person)()
        db.Commit()
        db.Dispose()
        db.Close()
      End Using
     Dim line = New MessageDialog("Table Created")
     Await line.ShowAsync()
  Catch
End Try

现在它不会创建任何表并得到一个异常,如下所示

在此处输入图像描述

谁能告诉我我哪里错了?

4

1 回答 1

1

来自:http: //goo.gl/mtJf70

SqlLite 包含非托管代码,除非部署 64 位版本,否则无法在 64 位操作系统上运行它。快速修复:项目 + 属性,构建选项卡,平台目标 = x86。

于 2013-09-23T16:44:58.170 回答