samedi 17 octobre 2015

SQLite query in Windows Store App return nothing

As i said in the title the query that i written retun nothing while the same tried in Valentina Studio to check the database work fine and i don't understand whats wrong. Here the code:

using System;
using System.Collections.Generic;
using System.Text;
using SQLite;

namespace SQLite_Analizer
{
    public class sqlite_master
    {
        public string name { get; set; }
    }

    public class manager
    {
        public List<string> GetListTables(string DBName)
        {
            List<string> tablesList = new List<string>();
            string itemName = null;
            var con = new SQLiteAsyncConnection(DBName);
            var query = con.QueryAsync<sqlite_master>("SELECT name FROM sqlite_master WHERE type='table' AND NOT SUBSTR(name,1,6) = 'sqlite' ORDER BY name").GetAwaiter().GetResult();        
            foreach(var tablesItem in query)
            {
                itemName = "\n" + tablesItem.name + "\n\n";
                tablesList.Add(itemName);
            }
            return tablesList;
        }
    }
}

Aucun commentaire:

Enregistrer un commentaire