0
votes

I have SQLite for Windows Phone 8.1 and now I need execute select command to obtain row or rows and save these in List. My function is this:

    public async Task<List<string>> execute_SelectCommand(string command)
    {
        //Declaration of variables
        List<string> stringList = new List<string>();

        try
        {
            stringList = await connectionDb.ExecuteScalarAsync<List<string>>(command);
            return stringList;
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.StackTrace.ToString());
            return stringList = null;
        }

    }

But in this code SQLite class give me a error.

enter image description here

This class can accept values as int, string, double but no List or array. Any idea what can I do? Thanks in advance!

1

1 Answers

0
votes

The ExecuteScalarAsync command is used to get the first column from the first row of the result set, that's why the debugger is telling you that it's not able to convert the result into a List<string>, you're probably looking for ExecuteQuery instead