0
我一直在使用SQLiteWinRT庫,並且我無法實現(我所知道的)異步操作在JavaScript的bucles中工作的等效性。 這裏是一個例子:javascript - 我如何執行await操作,而條件或等價條件呢?
await db.OpenAsync(SQLiteWinRT.SqliteOpenMode.OpenRead);
var stmt = await db.PrepareStatementAsync(
"SELECT name FROM sqlite_master WHERE type = 'table'"
);
//this is the part
while (await stmt.StepAsync())
{
string table = stmt.GetTextAt(0);
this.ViewModel.DatabaseTables.Add(table);
}
我希望能夠做正確的問題。