简体   繁体   English

使用vb.net和uwp在sqlite中编写查询

[英]Writing Queries in sqlite with vb.net & uwp

I have searched most of SO, and spent countless hours googling, so I'm going to post in the hopes that someone can help or just tell me it can't be done! 我已经搜索了大部分的SO,并花了无数的时间进行谷歌搜索,因此我将发布帖子,希望有人可以提供帮助或只是告诉我它无法完成!

I am trying to make my vb.net uwp application be able to query a local sqlite database with a test query, but I am at a complete loss trying to find an example or any sort of documentation that isn't in c# without a clear parallel to how to translate to vb.net. 我正在尝试使我的vb.net uwp应用程序能够使用测试查询来查询本地sqlite数据库,但是如果找不到一个示例或没有c#的任何类型的文档,我全力以赴与如何翻译为vb.net平行。

I have a base test class that can successfully connect with my database file, but I can't find anywhere how to do a query - all the resources online just link me to either vb.net without uwp or c# with uwp! 我有一个基本测试类,可以成功连接数据库文件,但是在任何地方都找不到查询方法-所有在线资源都将我链接到不带uwp的vb.net或带uwp的c#! I'll paste my code, but links to any resources or any advice would be so so helpful :) 我将粘贴代码,但是链接到任何资源或任何建议都将非常有用:)

Public Class dtbTest
Private conn As SQLiteConnection
Private sqcommand As SQLiteCommand
Private query As String = "SELECT * FROM userdetails"
Private cnn As SQLiteConnection
Private DBConnection As String = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "test.s3db")
Private tableInfo As List(Of SQLiteConnection.ColumnInfo)

Public Sub New()
    Try

        conn = New SQLiteConnection(DBConnection)
        conn.BeginTransaction()
        tableInfo = conn.GetTableInfo("userdetails")
        sqcommand.CommandText = query
    Catch

    End Try
End Sub

End Class

如果人们感兴趣,我可以通过尝试新的Microsoft.Data.SQL程序包使其正常工作,因此建议您检查是否有人遇到类似的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM