【问题标题】:Create table using SQLite in WinRT: BadImageFormatException在 WinRT 中使用 SQLite 创建表:BadImageFormatException
【发布时间】:2013-09-24 00:44:58
【问题描述】:

我正在使用Sqlite3 并将referene 添加到我的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

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

谁能告诉我我哪里出错了?

【问题讨论】:

    标签: vb.net sqlite windows-runtime visual-studio-2013 windows-8.1


    【解决方案1】:

    发件人:http://goo.gl/mtJf70

    SqlLite 包含非托管代码,不能在 64 位上运行 操作系统,除非您部署 64 位版本。快速解决: 项目 + 属性,构建选项卡,平台目标 = x86。

    【讨论】:

    • @Arjun-Awsome-感谢您的快速回答..这很神奇:)
    猜你喜欢
    • 1970-01-01
    • 2014-02-21
    • 1970-01-01
    • 2014-09-26
    • 2011-12-07
    • 1970-01-01
    • 1970-01-01
    • 2020-10-07
    • 2018-06-19
    相关资源
    最近更新 更多