[UWP] VB dot net加上UWP构建的SQLite错误 [英] [UWP]VB dot Net plus SQLite errors on UWP build

查看:69
本文介绍了[UWP] VB dot net加上UWP构建的SQLite错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨论坛,

我在使用带有UWP的SQLite运行此代码时遇到了问题,我在UWP上安装了sqlite,在PM中安装了包。

I had trouble running this code with SQLite with UWP, I installed the sqlite for UWP and the package in PM.

请建议。

以下是我使用的代码,但它返回了各种错误:

Below is the code I used but it returned various errors:

 

' The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

Imports SQLite.Net
''' <summary>
''' An empty page that can be used on its own or navigated to within a Frame.
''' </summary>
Public NotInheritable Class MainPage
    Inherits Page

    Private Sub Show_Click(sender As Object, e As RoutedEventArgs)

    End Sub

    Private Sub Add_Click(sender As Object, e As RoutedEventArgs)

    End Sub



    Private Sub listBoxEmployee_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles listBoxEmployee.SelectionChanged
        LoadEmployeeData()
    End Sub

    Public Sub LoadEmployeeData()
        Dim connectionString As String = "Data Source = Northwind.sqlite"
        Dim mSQL As String = "SELECT EmployeeID, FirstName || ' ' || LastName As FullName FROM Employees"
        Dim dt As DataTable = Nothing
        Dim ds As New DataSet

        Try

            Using con As New SQLiteConnection(connectionString)
                Using cmd As New SQLiteCommand(mSQL, con)
                    con.Open()
                    Using da As New SQLiteDataAdapter(cmd)
                        da.Fill(ds)
                        dt = ds.Tables(0)
                    End Using
                End Using
            End Using
            listBoxEmployee.ValueMember = "EmployeeID"
            listBoxEmployee.DisplayMember = "FullName"
            listBoxEmployee.DataSource = dt

        Catch ex As Exception
            '     MsgBox(ex.Message)
        End Try

    End Sub
End Class




推荐答案

嗨Delelittle7,

Hi Deerlittle7,

您能描述一下您的问题/问题吗?

Could you please describe more about your problem/issue?

 有哪些错误?您是否测试过可以访问数据库?

 What are the various errors? Have you tested that you can access to the database?

如果您能与我们分享一个简单的转载项目会更好,它将帮助我们更清楚地分析和诊断这个问题。

It will be better if you can share us a simple reproduced project, it will help us analyze and diagnose this issue more clearly.

最好的问候,

Jayden Gu

Jayden Gu





这篇关于[UWP] VB dot net加上UWP构建的SQLite错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆