dimanche 8 mai 2016

Sqlite query on uwp

How to code the UWP for sqlite query below:

Select word, translation 
from ind_dict 
where word like '?%'

I try to enter the code below, but the error message as shown below:

enter image description here

Code:

using (var statement = _connection.Prepare("SELECT word, translation FROM " + TABLE_NAME_IND + " WHERE word like '?%'"))
{
    //Ind.Word = inputText.Text;
    statement.Bind(1, Ind.Word);
    SQLiteResult result = statement.Step();

    if (SQLiteResult.ROW == result)
    {
        value = statement[Ind.Word] as String;
        value = statement[Ind.Translation] as String;
        indDatasource.Add(Ind);

        if (indDatasource.Count > 0)
        {
            translation.ItemsSource = indDatasource;
        }
    }
}

How to solve this?

Aucun commentaire:

Enregistrer un commentaire