[英]Windows Phone 8.1 Error with SQLite Class
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. 我有用于Windows Phone 8.1的SQLite,现在我需要执行select命令来获取一行或多行并将其保存在列表中。 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. 但是在这段代码中,SQLite类给我一个错误。
This class can accept values as int, string, double but no List or array. 此类可以将值接受为int,string,double,但不能包含List或数组。 Any idea what can I do?
知道该怎么办吗? Thanks in advance!
提前致谢!
ExecuteScalarAsync
命令用于从结果集的第一行获取第一列 ,这就是为什么调试器告诉您无法将结果转换为List<string>
,您可能正在寻找ExecuteQuery
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.