dimanche 14 février 2016

Trying to populate combobox from SQLite VB.NET Windows Universal App

I am new to SQLite and I am trying to populate a ComboBox in a Windows Universal App from the database. I did the following so far:

        With cmbPaciente.Items
        Try
            Dim sConexao As String = Path.Combine(ApplicationData.Current.LocalFolder.Path, "\Banco\Pronto Facil.db")
            Dim aConexao As New SQLite.SQLiteConnection(sConexao)
            Dim Comando = aConexao.Execute("select Nome from Dados_Pessoais")
            For Each item In Comando
                .Add(item)
            Next
        Catch ex As Exception
            .Add("João Silva")
            .Add("José dos Anzóis")
        End Try
    End With

I am getting this error:

BC32023 Expression is of type 'Integer', which is not a collection type.    

I understood thats because aConexao.Execute is returning an integer, but how else should I do it then?

Aucun commentaire:

Enregistrer un commentaire