I'm trying to convert some older code for Windows 8 using SQLite. Below is a code from a previous session that works.
using (SqliteConnection conn = new SqliteConnection("Version=3,uri=file://flashcards0904.db"))
{
conn.Open();
using (SqliteCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "SELECT * FROM Decks where DeckGroup='" + Global.currentDeckGroup.ToString() + Global.currentDeck.ToString() + "'" + "order by random()";
List<string> myCollection = new List<string>();
using (SqliteDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
myCollection.Add(reader.GetString(0) + "~" + reader.GetString(1) + "~" + reader.GetString(2));
Global.words = myCollection.ToArray();
}
}
conn.Close();
Community.CsharpSqlite.FileStream.HandleTracker.Clear();
}
}
Now, I don't have access to SqliteDataReader and I'm trying to use a List<> function, but I cannot get the "Where" clause to work. Any help, here is my current code:
var root = Windows.Storage.ApplicationData.Current.LocalFolderPath;
var dbPath= Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolderPath,"flashcards0904.db");
using( var db= new SQLite.SQLiteConnection(dbPath))
{
// Here is location for the missing Where Clause"
var list= db.Table<Decks>.Where??????? .ToList();
}
Hope this explains the problem.
Thanks